in reply to Is it safe to append to the array you are iterating over
If you don't mind consuming the array:
or a manual index value to preserve the array contents:while (@array) { $item = shift @array; ... push @array, @newstuff; }
for (my $i=0; $i< $#array; $i++) { ... push @array, $thing if desired(); }
In Section
Seekers of Perl Wisdom