http://www.perlmonks.org?node_id=1078458


in reply to Re: Given When Syntax
in thread Given When Syntax

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!

Replies are listed 'Best First'.
Re^3: Given When Syntax
by ww (Archbishop) on Mar 15, 2014 at 16:29 UTC

    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.