in reply to Re: if or switch?
in thread if or switch?

I'm curious about why you rejected switch as an option...

Its own documentation suggests that it can fail with mysterious errors.

Replies are listed 'Best First'.
Re^3: if or switch?
by NetWallah (Canon) on Jul 11, 2008 at 17:06 UTC
    chromatic - are you red flagging (or yellow-flagging) the use of the switch statement ?

    If so, could you specify which version you had bad experience with ?

    • Switch Module? V5 or V6 option ?
    • Perl6 (Rakudo, or pugs)?
    • Perl 5.10 "feature" module ?
    • Perl5 FAQ that fakes out "case" ?
    Was this an esoteric case ?

    Your response could help the community either toward reproducing and fixing bugs, or by directing programming practices based on your recommendation.

         Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax

      See the documentation for the core Switch module. given/when in Perl 5.10 is more robust, and Perl 6 works effectively.

      The failure case isn't too esoteric; the use of regular expressions in your code can confuse Switch.