Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Given When Syntax

by hazylife (Monk)
on Mar 15, 2014 at 15:53 UTC ( #1078453=note: print w/replies, xml ) Need Help??

in reply to Given When Syntax

use feature 'switch';


Replies are listed 'Best First'.
Re^2: Given When Syntax
by Deep_Plaid (Acolyte) on Mar 15, 2014 at 16:12 UTC

    Hi HazyLife. I did consider using the Switch module, but I had read that it is being deprecated and that I should be using given/when, and that is is more efficient. No other reason I can't or won't - I was just curious why I'm getting the syntax errors for given/when. Also, this is a part of a much larger script that has a long processing time and I'm trying to be as efficient as possible. Thanks for your input!

      re hazylife's observation, you need to understand that...
            use feature "switch";" is NOT EQUAL to use Switch;.

      Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
      1. code
      2. verbatim error and/or warning messages
      3. a coherent explanation of what "doesn't work actually means.
        True, but the switch and smartmatching features (given+when and ~~) are also experimental and likely to change.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2022-08-10 11:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found