Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 musing on the Monastery: (3)
As of 2016-07-01 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (405 votes). Check out past polls.