http://qs1969.pair.com?node_id=1023514


in reply to Is it safe to append to the array you are iterating over

You can easily make that safe by substituting a list of indexes for the actual items:

my @arr = qw/a b c/; foreach ( 0 .. $#arr ) { $_ = $arr[ $_ ]; push @arr, 'd' if $_ eq 'a'; push @arr, 'e' if $_ eq 'b'; push @arr, 'f' if $_ eq 'c'; print $_; } print "\n";

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.