in reply to Re^11: eof not recognised when applying diamond operator to invocation arguments?
in thread eof not recognised when applying diamond operator to invocation arguments?
Good grief!! Even the Perl documentation makes the distinction between the two:
I didn't say what you do makes no sense; I said the reason you gave makes no sense. It doesn't mean there are no other reasons that do make sense.
but the documentation starts off by using "for" to describe the C-style form of "(;;)
C-style loops are almost always used as for loops, so that's pretty accurate (although they are really just while loops.)
and "foreach" to describe the Perl-style form of "$var (list)".
Actually, the documentation isn't as clear as your purport it to be. It appears that section was written to describe that syntax, but it says "The foreach loop iterates over a normal list value and sets the variable VAR to be each element of the list in turn." for VAR (EXPR..EXPR) doesn't match that definition.
The Perl documentation is one of those that seem to forget about Perl-style for loops.
So I'm perfectly in line with how the Perl documentation describes them.
But I'm asking about that case that's not documented! So we've looped back to here.
My point about discouraging "for" loops was if the two were actually two distinct looping styles
If the two were actually two distinct looping styles, ...? Part of that sentence seems to be missing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: eof not recognised when applying diamond operator to invocation arguments?
by Argel (Prior) on Jan 17, 2011 at 23:42 UTC | |
by ikegami (Patriarch) on Jan 18, 2011 at 19:40 UTC | |
by tilly (Archbishop) on Jan 18, 2011 at 19:49 UTC | |
by ikegami (Patriarch) on Jan 18, 2011 at 20:33 UTC | |
by tilly (Archbishop) on Jan 18, 2011 at 21:12 UTC | |
| |
by Argel (Prior) on Jan 18, 2011 at 23:18 UTC |