Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your code will either not print anything, or it'll never finish printing.
You're right, I forgot the $junk--; after the print statement. That's a pretty bold statement, considering many languages do have a 'switch', perl6 will have a switch, there's Switch.pm, both the manual and the FAQ discuss it (without dismissing it as choicing a bad algorithm), and it has been on the wishlist since the very first release of Perl in 1987. I never said switch was bad code. Perl6 will have a switch because a lot of people want it, and it is very readable. However, switch statements are unbelievably over-used. I stand by my statement; chances are, if your algorithm needs switch, you can come up with a better algorithm. There are, of course, a few exceptions. As to your "considering many languages have a 'switch'", multiplicity does not correctness make.
-- $me = rand($hacker{perl}); In reply to Re^3: fall through switch/case in perl
by radiantmatrix
|
|