Help for this page
grep &$code, @list
mygrep \&$code, @list
sub mygrep (&@) { my ( $code, @list ) = @_; return grep &$code, @list +} sub gt { my ( $test ) = @_; return sub { $_ > $test } } grep &{ gt 1 }, qw/1 2 3 1 4/; => () mygrep \&{ gt 1 }, qw/1 2 3 1 4/; => ( 2, 3, 4 )