Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Is it safe to append to the array you are iterating over

by ikegami (Pope)
on Mar 16, 2013 at 19:53 UTC ( #1023847=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @arr = qw/a b c/;
    for (my $i=0; $i<@arr; ++$i) {
    ...
        print $e;
    }
    print "\n";
    
  2. or download this
    my @arr = qw/a b c/;
    while (@arr) {
    ...
        print $e;
    }
    print "\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (17)
As of 2014-08-27 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (238 votes), past polls