Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: foreach array - delete current row ?

by AnomalousMonk (Abbot)
on Jun 03, 2013 at 07:01 UTC ( #1036678=note: print w/ replies, xml ) Need Help??


in reply to Re: foreach array - delete current row ?
in thread foreach array - delete current row ?

@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


Comment on Re^2: foreach array - delete current row ?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036678]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2014-11-28 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (198 votes), past polls