The problem with iterating over indices is that BUU is iterating over a sorted temporary list, so if you don’t create it en passant in the foreach() list, you need to store it in a temporary array variable. And since you have a temp array, you can afford to destroy it, so the simplest approach is while( @list ) { ...; shift @list }.
Makeshifts last the longest.
In reply to Re^2: Last undefines a for loop's itererator?
by Aristotle
in thread Last undefines a for loop's itererator?
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |