I thought you were referring to the off-by-one error, and didn't notice it also iterated backwards.
Solutions:
for ( -$#array..0 ) { ... $array[-$_] ... }
for ( my $i=@array; $i--; ) { ... $array[$i] ... }
In reply to Re^4: Efficient array element deletion
by ikegami
in thread Efficient array element deletion
by kennethk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |