in reply to Would you use a switch instead?

Perl has no switch statement. Maybe you mean a dispatch table, which I'd consider using, or a given statement, if you're using Perl 5.10 or higher.

Replies are listed 'Best First'.
Re^2: Would you use a switch instead?
by Anonymous Monk on Jul 04, 2009 at 13:16 UTC
    Perl has no switch statement

    There is the switch module or given/when, etc. Plus, you can mimic a switch with if/else's (although I never liked doing so).