Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2016-06-29 21:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (387 votes). Check out past polls.