In php I can stack case statements, can I do equivalent with perl?
switch($myValue)
{
case "one":
case "two":
break;
case "three":
break;
default:
break;
}
Switch statements in Perl>= 5.10 are implemented using
givenandwhenconstructs. It is highly flexible due to smart-matching of the value passed togiven.You could even write
when ( [qw/one two/] )aswhen ( /one|two/ ).