in reply to Re^4: the '..' operator and decreasing values
in thread the '..' operator and decreasing values

It seems perl586delta fooled lots of us. I did som testing and it turns out that reverse 0..100 will turn 0..100 to a list of 101 elements and traverse that list from the end.
for ( reverse 0 .. 100_000_000) {};
Wants to grab lots of memory and gets killed by my OS, without reverse it works nicely. Tried with perl5.8.6 and perl5.9.1.

Replies are listed 'Best First'.
Re^6: the '..' operator and decreasing values
by doom (Deacon) on Mar 06, 2005 at 00:28 UTC
    And you guys are reporting this bug to perl5-porters, right?
      There's no bug. As of 5.8.6 (or maybe 5.8.5, didn't check that) the reverse is indeed optimized away. However, the .. operator is still evaluated to produce the full list (at compile time). So there's a potential for optimizing that away also, but you can't actually call it a bug.