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


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

Hi Rolf. As I mentioned to HazyLife, I could have used Switch and I also thought of using an array, as you have demonstrated above, but in the actual program I'm running I'm already in the middle of hash. I will try if I can do this there, however. I'm trying to do this the most efficient way and I don't have a whole lot of PERL experience. Thanks for replying!!

Replies are listed 'Best First'.
Re^3: Given When Syntax
by LanX (Saint) on Mar 15, 2014 at 16:29 UTC
    I think you are getting it wrong, Given/When are activated by the feature pragma with the keyword switch or with an indication of the first Perl version which supports it.(not a Switch module)

    The deprecation also affects Given/When, because of the built-in use of smartmatch. We had a discussion recently, should be easily found.

    In the post above I updated a link to a thread showing how to easily emulate Given/When with For/If!

    HTH! :)

    Cheers Rolf

    ( addicted to the Perl Programming Language)