teg:
I'd advise you to avoid the Switch module. If you want something similar and you're on perl 5.10 or later, you're in luck:
use strict; use warnings; use fature ':5.10'; my $foo = 7; given ($foo) { when (1) { say "foo is one!" } when ([2 .. 5]) { say "foo is one of 2, 3, 4 or 5" } default { say "Eh ... wrong foo!" } }
...roboticus
In reply to Re: Nested Switch case
by roboticus
in thread Nested Switch case
by tej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |