in reply to switch statement for subroutines?
my %subhash = { do_run => \&do_run, do_walk => \&do_walk, do_skip => \&do_skip }; foreach ( @do_something ) { if ( defined $subhash{ $_ } ) { &{ $subhash{ $_ } }(); } }
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: switch statement for subroutines?
by abstracts (Hermit) on Jul 28, 2001 at 02:58 UTC |