- or download this
eval('&' . $action . '()');
if( $@ ) {
die "Usage\n";
}
- or download this
my $subref = \&{$action};
die "Usage" unless defined &$subref();
- or download this
my %dispatch = (
'this' => \&do_this,
...
if (defined $dispatch{$action}) {
&$dispatch{$action};
} else { die "Usage\n"; }