in reply to switch statement for subroutines?

CPAN is your friend, grasshopper:
use Switch; foreach my $val (@array) { switch ($val) { case "do_walk" { do_walk() } case "do_run" { do_run(); } case "do_skip" { do_skip(); } } }

ar0n ]

Replies are listed 'Best First'.
(tye: don't use Switch) Re: switch statement for subroutines?
by tye (Sage) on Jul 28, 2001 at 10:44 UTC

    This module is rather fragile and many would never allow into their production code. If you use it, don't be surprised if your code breaks later when you make what looks like a rather innocent change.

            - tye (but my friends call me "Tye")