in reply to Efficient array element deletion
for (-$#array .. 0) { ...
I don't think that's going to do quite what you intended.
J:\>perl -le "@arr = ( 1 .. 10 ); print $arr[ $_ ] for - $#arr .. 0;" 2 3 4 5 6 7 8 9 10 1 J:\>
Perhaps this instead.
J:\>perl -le "@arr = ( 1 .. 10 ); print $arr[ $_ ] for reverse 0 .. $# +arr;" 10 9 8 7 6 5 4 3 2 1 J:\>
Cheers,
JohnGG
|
|---|