in reply to Re: Hard syntax error or disambiguable parsing?
in thread Hard syntax error or disambiguable parsing?
A foreach loop (which you've written there misspelled as "for")
eh? Not only are the keywords interchangeable, but for $i ( 0 .. 5 ) is not a foreach loop as defined in perlsyn. It shares traits with both foreach loops (syntax) and for loops (purpose and efficiency).
It's not as clear, and this is clearly a beginner, so I thought I'd bring clarity back.
So how do you decide which keywords to use? Choosing the keyword based on syntax (looks like a list or not) is redundant. The only meaningful criteria I can think of are memory efficiency (you'd use for here) or purpose (you'd use for here).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Hard syntax error or disambiguable parsing?
by BrowserUk (Patriarch) on Jan 29, 2009 at 08:24 UTC | |
by TimToady (Parson) on Jan 30, 2009 at 19:11 UTC | |
by BrowserUk (Patriarch) on Jan 30, 2009 at 19:55 UTC | |
|
Re^3: Hard syntax error or disambiguable parsing?
by rovf (Priest) on Jan 29, 2009 at 09:02 UTC | |
by ikegami (Patriarch) on Jan 29, 2009 at 13:40 UTC |