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