To answer your last questions, it keeps modifications both to the input and output arrays.sub extract (&\@) { my ($code, $aref) = @_; my @return; my @replace; for (@$aref) { # aliases $_ to the item in the original list if (&$code) { push @return, $_; } else { push @replace, $_; } } @$aref = @replace; return @return; }
In reply to Re: RFC: List::Extract
by merlyn
in thread RFC: List::Extract
by lodin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |