Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: switch statement

by 2teez (Vicar)
on Sep 20, 2013 at 04:44 UTC ( #1054955=note: print w/replies, xml ) Need Help??

in reply to switch statement

Hi virtuemart2,

I got a stupid programming question: can switch statment inside switch statement? I mean switch inside a switch? double switch
One of the paragraph of one of the links you provided namely Switch.html says and I quote
Note that switch -es can be nested within case (or any other) blocks, and 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...

More importantly, you may want to use given/when instead of switch because old Switch used source filtering and had other limitations. Please read the Documentations of the links you provided for this.
Lastly, you could also try this thing out and see what you get anyway.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Replies are listed 'Best First'.
Re^2: switch statement
by virtuemart2 (Novice) on Sep 23, 2013 at 06:24 UTC
    "you may want to use given/when instead of switch because old Switch used ..."

    I have to use old one, switch statement

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054955]
shmem is bored... sending limericks to the auth log

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2018-02-20 15:57 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (271 votes). Check out past polls.