![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re^2: for loop syntax differenceby Taulmarill (Deacon) |
on Aug 28, 2009 at 14:05 UTC ( #791914=note: print w/replies, xml ) | Need Help?? |
I believe the "for" in the docs refers to a C-style loop (for($i=0;$i<10;$i++)) and the "foreach" refers to the more Perlish style (for $i (1..10)). Yes, however for and foreach are interchangeable since perl automatically detects which one to use.
In Section
Seekers of Perl Wisdom
|
|