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