in reply to switch statement
G'day virtuemart2,
Unfortunately, your post is ambiguous. This is an instance where case is important. Are you talking about switch (lowercase), as you've written twice as "switch statement"; or, are you talking about Switch (uppercase), a module you've shown two links for?
The 'Switch' Module
- This module was deprecated in 5.12.0 - see "perl5120delta: Deprecated Modules".
- It was removed from the core distribution in 5.14.0 - see "perl5140delta: Removed Modules and Pragmata".
- It is still available on CPAN - see "Switch".
The 'switch' Feature
- This was introduced in 5.10.0 - see "perl5100delta: Switch and Smart Match operator".
- It provided three new keywords: given, when and default. Together, they can be used to write a switch statement.
- It is highly experimental! It is subject to change with little notice and, as such, is not suitable for production code - see "perlsyn: Experimental Details on given and when".
Your Original Question
As explained, the ambiguous nature of your question means I don't really know exactly what you're asking. However, by way of an answer, here's another question: "Why don't you try it yourself and see?"
[Aside: Please see "What shortcuts can I use for linking to other information?" to post actual links instead of URLs as text.]
-- Ken
In Section
Seekers of Perl Wisdom