midnightswan
Programmer
Hi,
I was wondering if I can do this in Perl (multiple cases attached to 1 case block:
I know it can be done in like C++, Java etc, but I can't get it to work in Perl. I tried reading the info about the "Switch" module in CPAN, and it says this:
Link to CPAN ---> CPAN.org Switch Module Page
That section of text I just quoted is just under the 3rd grey box down the page.
I hope someone can help me : o)
Thanks in advance,
MS
I was wondering if I can do this in Perl (multiple cases attached to 1 case block:
Code:
use Switch;
switch($var)
{
case 'i'
case 'j'
{
#... some code ...
{
case 'x'
case 'y'
{
#... more code ...
}
}
I know it can be done in like C++, Java etc, but I can't get it to work in Perl. I tried reading the info about the "Switch" module in CPAN, and it says this:
a series of case statements can try different types of matches -- hash membership, pattern match, array intersection, simple equality, etc. -- against the same switch value.
Link to CPAN ---> CPAN.org Switch Module Page
That section of text I just quoted is just under the 3rd grey box down the page.
I hope someone can help me : o)
Thanks in advance,
MS