Does Perl have the equivalent of a case statement or a switch statement. I'm
trying to avoid a bunch of "if-then" statements. I'm seeing posts regarding
"use switch", but I want to make sure it's not a deprecated practice. I'm using
Perl -v 5.8.0.
my $day;
if ($day = "mon") {
$num = 0;
}
if ($day = "tue") {
$num=1;
}
...etc.
I'll be using $num, as an index, to extract a value from an array later on.
TIA,
Ron- select case or switch statement Ron Smith
- Re: select case or switch statement Ing. Branislav Gerzo
- Re: select case or switch statement Ron Smith
- Re: select case or switch statement Jeff 'japhy' Pinyan
- Re: select case or switch statement Chris Devers
- Re: select case or switch statement Omega -1911
- RE: select case or switch statement Charles K. Clarkson
