June 2002
Beginner
759 pages
80h 42m
English
A collection of list-related subroutines. As of Perl 5.8, List::Util is included with the Perl source kit.
You can get the first item of a list (that matches the condition in BLOCK) like so:
#!/usr/local/bin/perl -w
use List::Util qw(first);
my @ll = qw(one two three);
my $fir = first { defined($_) } @ll;
print "$fir\n"; # Prints 'one'List::Util implements (but does not export) the following methods.