Help for this page

Select Code to Download


  1. or download this
    grep &$code, @list
    
  2. or download this
    mygrep \&$code, @list
    
  3. or download this
    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 )