You'll note that the methods noted in above post, while supporting the general use of switch, do not support default fall-through like C does. To be fair, this is one of the most contreversial features in C (culminating in Duff's Device), but arguments over potential abuse of a feature never stopped Perl before. So it's no small irony that even Java supports a more C-ish switch statment then Perl does.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
In reply to Re: Switch
by hardburn
in thread Switch statement in Perl?
by Lhamo_rin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |