in reply to Re^3: For vs. Foreach
in thread For vs. Foreach
If you break out foreach $n (1..10) { } as separate from foreach $n (LIST) { }, then you should also break out foreach $item (@an_array) {} as a special kind of foreach as well, since a list copy is not made.
And then you'd also have to break out a slice too. Or any other array lvalue.
I think your false distinction of "counting loop" as separate is just that. False. There are two kinds of loops: for and foreach. They each have subfeatures. That's it. Not three kinds.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: For vs. Foreach
by BrowserUk (Patriarch) on Feb 14, 2009 at 04:01 UTC | |
by merlyn (Sage) on Feb 15, 2009 at 04:40 UTC | |
by BrowserUk (Patriarch) on Feb 15, 2009 at 05:13 UTC | |
Re^5: For vs. Foreach
by ikegami (Patriarch) on Feb 14, 2009 at 03:19 UTC | |
Re^5: For vs. Foreach
by Anonymous Monk on Feb 14, 2009 at 01:27 UTC |
In Section
Seekers of Perl Wisdom