in reply to Re: foreach to for
in thread foreach to for
Unfortunately, the story is about as clear as mud. In recent Perl's, there are optimizations to avoid generating the entire list up front when and where possible. For instance:
You will see by checking memory consumption that the list is not generated.for (1 .. 2_000_000_000) { print "$_\n"; }
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: foreach to for
by GrandFather (Saint) on Jun 18, 2006 at 23:41 UTC |