in reply to Re^7: eof not recognised when applying diamond operator to invocation arguments?
in thread eof not recognised when applying diamond operator to invocation arguments?
Actually, I do use "for" for C-style iterations and "foreach" for the more Perlish iterator loops! I like to use what "feels" right
Did you read the post to which you replied? ("Why is it always C-style loops (usually used as counting loops) vs list iterator loops? Perl-style counting loops are always ignored.")
So what do you use for Perl-style for loops?
for (1..5) { say; } foreach (1..5) { say; }
Quite frankly, I wish they were distinct so we could discourage "for" loops and encourage "foreach" loops without any ambiguity
For loops are very important and should not be discouraged in the least. Just the C-style ones are hard to read.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: eof not recognised when applying diamond operator to invocation arguments?
by Argel (Prior) on Jan 14, 2011 at 23:48 UTC | |
by BrowserUk (Patriarch) on Jan 15, 2011 at 00:52 UTC | |
by ikegami (Patriarch) on Jan 17, 2011 at 16:54 UTC | |
by Argel (Prior) on Jan 17, 2011 at 22:35 UTC | |
by ikegami (Patriarch) on Jan 17, 2011 at 23:16 UTC | |
by Argel (Prior) on Jan 17, 2011 at 23:42 UTC | |
|