Algorithm-Loops
view release on metacpan or search on metacpan
lib/Algorithm/Loops.pm view on Meta::CPAN
use Algorithm::Loops qw( Filter );
it gets declared before the rest of our code is compiled so we don't have
to use parentheses when calling it. We I<can> if we want to, however:
my @copy= Filter( sub {s/\s/_/g}, @list );
=head3 Note on "Function BLOCK LIST" bugs
Note that in at least some versions of Perl, support for the "Filter
BLOCK ..." syntax is somewhat fragile. For example:
... Filter( {y/aeiou/UAEIO/} @list );
may give you this error:
Array found where operator expected
which can be fixed by dropping the parentheses:
... Filter {y/aeiou/UAEIO/} @list;
( run in 0.534 second using v1.01-cache-2.11-cpan-b16cb0d3907 )