in reply to RE: RE: Simple menu..
in thread Simple menu..

You need to dereference the function name, see 11.4 in the cookbook # entering 'happy' runs the routine 'joy' eg %command = ( "happy" => \&joy ); chomp($feeling = <STDIN>); if($command{$feeling}){ $command{$feeling}->(); } sub joy{ print "happy huh \?"; }