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

Re^5: perldelta unclear on 'given's fate

by dasgar (Deacon)
on Jan 04, 2014 at 16:31 UTC ( #1069297=note: print w/ replies, xml ) Need Help??


in reply to Re^4: perldelta unclear on 'given's fate
in thread perldelta unclear on 'given's fate

If you want to use some kind of switch statement, you could always try searching CPAN for a switch module.

One module that I've recently used was Switch::Plain. If I understand the documentation correctly, it does not use smartmatch. However, it is limited to "simple string or numeric equality tests". The module's author also includes in the documentation a comparison between this module's implementation of switch and C's switch. Depending on your needs, this module might provide what you're looking for since it does provide a "switch/case/default" construct.


Comment on Re^5: perldelta unclear on 'given's fate
Re^6: perldelta unclear on 'given's fate
by tobyink (Abbot) on Jan 04, 2014 at 17:06 UTC

    Also consider Switcheroo. :-)

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (17)
As of 2014-10-20 19:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (89 votes), past polls