Which is okay for small ranges; but creates a huge list for large ones.
:) seems like an easy candidate for optimization , since this is optimized for (reverse @a) is optimized
perl -le " @f = 1 .. 100_000; for(reverse @f ){ $f=$_; $f==$#f and sca +lar<> } " perl -le " @f = 1 .. 100_000; for( @f ){ $f=$_; $f==$#f and scalar<> } + "
In reply to Re^2: counting backward (optimize foreach reverse low .. high
by Anonymous Monk
in thread counting backward
by ag4ve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |