%command_list = qw( quit end_program() greeting greeting() time systime() help help() log log_status() ); #### %log = qw(start start_logs() stop stop_logs() ); } #### $command = ; # assume $command="log start" @cl =split / /,$command; # if we have multi word command... if (!(defined($cl[1]))){ #single word command chop $cl[0]; $command_action= $command_list{$cl[0]}; } else { #multi word command chop $cl[1]; print "$cl[0]\n"; #command print "$cl[1]\n"; #options to that command $command_action= $cl[0]{$cl[1]}; #trying to set $command_action = to "$log{start}; } eval $command_action; die "\n" if $@; }