Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Re: Splice of ref to AoH not removing elementby liz (Monsignor) |
on May 30, 2004 at 12:59 UTC ( [id://357606]=note: print w/replies, xml ) | Need Help?? |
Adding to or removing from an array you're iterating over is a bad idea. If you create a loop over two elements (indices 0 and 1) and, on the first iteration, remove one element, what will happen on the second iteration?
However, if you would iterate in reverse order (1,0) then there would be no problem at all. Liz
In Section
Seekers of Perl Wisdom
|
|