in reply to Multiple foreach loops in single statement
Statement modifiers are not nestable. But since
is legal, so isdo { ... } for ...;
do { ... for ... } for ...;
But for readability's sake, just don't do that! Especially since
while (...) { ...}
and
do { ...} while ...;
have different semantics.
A functional language approach would probably achieve what you want better.
print map ord, split //, `cat file.pl`;
(Yeah, the outer loop is useless, as you can see.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Multiple foreach loops in single statement
by gurpreetsingh13 (Scribe) on Oct 24, 2012 at 03:36 UTC | |
by Athanasius (Archbishop) on Oct 24, 2012 at 04:11 UTC | |
by gurpreetsingh13 (Scribe) on Oct 24, 2012 at 14:51 UTC | |
by gurpreetsingh13 (Scribe) on Oct 24, 2012 at 13:22 UTC | |
by Anonymous Monk on Oct 24, 2012 at 13:30 UTC | |
by Athanasius (Archbishop) on Oct 24, 2012 at 13:56 UTC | |
by ikegami (Patriarch) on Mar 02, 2013 at 22:54 UTC |
In Section
Seekers of Perl Wisdom