Help for this page

Select Code to Download


  1. or download this
        my %commands = (
            cmd1 => \&do_cmd1,
            cmd2 => \&do_cmd2,
            ....
        );
    
  2. or download this
        ## untested, just something I thought up right now
        chomp( $input = <STDIN> );
    ...
        if( defined( $commands{ $cmd } ) ) {
            $command{ $cmd }->( @args );
        }