|
|
| more useful options | |
| PerlMonks |
Re^2: Foreach Loopsby Anonymous Monk |
| on Mar 16, 2005 at 15:16 UTC ( #439976=note: print w/ replies, xml ) | Need Help?? |
|
You say that for my $x (0 .. $#arr) is "better" than for (my $x = 0; $x < @arr; $x ++). Now, I don't care much what you find better, but since you have a preference that you find important enough to advocate, I'm interested in why you find your preference "better". It's even optimized to not create the list.Yeah, because it's special cased. The C-style loop doesn't create a list at all, and is even "optimized" in older versions of Perl.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||