in reply to how to deal with 20 commands

you can use a switch statement i think. in my opinion its better than 20 if statements!

Replies are listed 'Best First'.
Re^2: how to deal with 20 commands
by holli (Abbot) on May 23, 2005 at 04:57 UTC
    Never, never recommend Switch.pm. It's a source filter that has serious bugs and is likely to break your code.


    holli, /regexed monk/

      He didn't recommend Switch.pm.

      And yes, there is an alternative.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.