Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: switch statement

by 2teez (Priest)
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]
[erix]: first we take Berlin ...
[erix]: (Manhattan has fallen already)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2017-03-28 08:45 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (328 votes). Check out past polls.