Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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


Comment on Re: switch statement
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054955]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (16)
As of 2014-07-23 14:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (144 votes), past polls