Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: How can I delete an element in a foreach cycle?

by jasonk (Parson)
on Mar 02, 2010 at 04:35 UTC ( #826071=note: print w/replies, xml ) Need Help??


in reply to Re: How can I delete an element in a foreach cycle?
in thread How can I delete an element in a foreach cycle?

Or just go backwards...

for my $i ( reverse 0 .. $#ARGV ) { splice( @ARGV, $i, 1 ) if $ARGV[$i] eq 'hello'; }

www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826071]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2016-12-08 02:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (134 votes). Check out past polls.