For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

last_non_null

Split the input on ASCII NUL ("\0") characters and returns the last non-null element in the resulting list.

Also see the line and oneline filters.

Example

[perl]
$Tag->filter({
    op => 'last_non_null',
    body => "One\0Two\0Three\0\0\0",
});
[/perl]

Results in:

Three

Source code

sub {
    my @some = reverse split /\0+/, shift;

    for(@some) {
        return $_ if length $_;
    }
    return '';
}

Category:  Filters
Last modified by: Kevin Walsh
Modification date: Monday 26 February 2007 at 11:49 AM (EST)
Home  |  Legal nonsense  |  Privacy policy  |  Contact us