Help for this page

Select Code to Download


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