Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 having an uproarious good time at the Monastery: (7)
As of 2015-05-24 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (470 votes), past polls