in reply to fall through switch/case in perl
for ( $var ) { $_ == 10 and print "a"; $_ == 9 and print "b"; $_ == 8 and print "c"; $_ == 7 and print "d"; $_ == 6 and print "e"; $_ == 5 and print "f"; $_ == 4 and print "g"; $_ == 3 and print "h"; $_ == 2 and print "i"; $_ == 1 and print "j"; }
There are about ten million other ways to say the same, of course.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: fall through switch/case in perl
by shenme (Priest) on Sep 07, 2004 at 00:10 UTC | |
by Aristotle (Chancellor) on Sep 07, 2004 at 00:38 UTC | |
by tachyon (Chancellor) on Sep 07, 2004 at 00:44 UTC | |
by Aristotle (Chancellor) on Sep 07, 2004 at 00:46 UTC | |
by tachyon (Chancellor) on Sep 07, 2004 at 00:49 UTC | |
| |
|
Re^2: fall through switch/case in perl
by PerlingTheUK (Hermit) on Sep 07, 2004 at 16:05 UTC | |
by Aristotle (Chancellor) on Sep 07, 2004 at 16:13 UTC |