|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re^4: Hard syntax error or disambiguable parsing?by ikegami (Patriarch) |
| on Jan 29, 2009 at 13:40 UTC ( [id://739900]=note: print w/replies, xml ) | Need Help?? |
|
You probably think the ".." in "for[each] $i ( 0 .. 5 )" is the range operator and that it creates a list of 6 elements. It's not, and no list of 6 elements is created. perlsyn distinguishes between For Loops ("C"-style For Loops) and Foreach Loops (List Iteration Loops), but "for[each] $i ( 0 .. 5 )" is neither. It's actually a Counting Loop like FOR ... NEXT in BASIC.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||