sub settime($){ print "nMetrics>You have entered the settime command\n"; print "nMetrics>The argument given is $_[0]\n";} sub showtime{ print "nMetrics>You have entered the show time command\n";} sub error{ print "nMetrics>Invalid command line options\n";} $myhash{"set time"}=\&settime; $myhash{"show time"}=\&showtime; $myhash{default}=\&error; print "Welcome to nMetrics application monitor\n"; print "Please type in a command\n"; label:print "nMetrics>"; while() { chomp; if (exists $myhash{$_}) {$myhash{$_}->();} else {$myhash{default}->();} goto label; }