# This is a fairly useless function which is basically # just a copy of grep which enforces numeric context # on the list items... # sub filter_nums (&@) { my $coderef = shift; return grep { $coderef->() } map { 0 + $_ } @_ } my @even = filter_nums { not($_ % 2) } qw(1 2 3 4 potato);