Help for this page

Select Code to Download


  1. or download this
    my @array = qw(hi hello howdy);
    my @hellos = grep_and_remove { $_ eq 'hello' } @array;
    ...
              'hi',
              'howdy'
            ];
    
  2. or download this
    sub grep_and_remove (&\@) {
        my ($cb, $array_ref) = @_;
    ...
    
        return @found;
    }