- or download this
my %actions = (
this => \&this,
...
foo => \&foo,
bar => \&bar,
zzz => \&sleepytime);
- or download this
if($in eq "this"){&this}
if($in eq "that"){&that}
if($in eq "foo"){&foo}
if($in eq "bar"){&bar}
if($in eq "zzz"){&zzz}
- or download this
foreach(@actions){ if($in eq $_){&$_()}}
- or download this
$in=param('in');
@actions=qw(this that foo bar zzz);
foreach(@actions){ no strict "refs"; if($in eq $_){&$_()}}