@list = grep( &keep_me, @list);
I would add that the keep_me() function of the example must operate on the $_ default scalar, which is topicalized by grep.
>perl -wMstrict -le "sub keep_me { return m{ [[:upper:]] }xms; } ;; my @list = qw(a b K d E f g h E P m e); @list = grep &keep_me, @list; print qq{@list}; " K E E P
In reply to Re^2: foreach array - delete current row ?
by AnomalousMonk
in thread foreach array - delete current row ?
by JockoHelios
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |