I've decided to change my code to instead use a while loop/shift solution similar to what you suggested. It's approximately as simple as my original and doesn't have this issue of possibly depending on an undocumented implementation detail of my version of Perl.
in reply to Re: Is it safe to append to the array you are iterating over
in thread Is it safe to append to the array you are iterating over
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."