in reply to Re^3: Efficient array element deletion
in thread Efficient array element deletion
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] ... }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Efficient array element deletion
by BrowserUk (Patriarch) on Dec 05, 2008 at 14:11 UTC | |
by kennethk (Abbot) on Dec 07, 2008 at 15:33 UTC |