Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by ikegami (Patriarch)
on Mar 16, 2013 at 19:53 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1023847]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-03-28 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found