in reply to Nested Switch case
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Nested Switch case
by CheeseConQueso (Initiate) on Nov 29, 2010 at 15:17 UTC | |
by cdarke (Prior) on Nov 29, 2010 at 15:46 UTC | |
by roboticus (Chancellor) on Nov 29, 2010 at 16:51 UTC | |
by Fletch (Bishop) on Nov 29, 2010 at 21:58 UTC | |
by amir_e_a (Hermit) on Nov 29, 2010 at 22:29 UTC | |
|
Re^2: Nested Switch case
by tej (Scribe) on Nov 29, 2010 at 14:54 UTC | |
by roboticus (Chancellor) on Nov 29, 2010 at 15:02 UTC | |
by marto (Cardinal) on Nov 29, 2010 at 14:59 UTC |