sub more { print "more()\n" } sub fallover { print "fallover()\n" } print "Welcome to johns fun house\n"; print " : "; my $command=<>; chomp $command; if ($command eq "fun") { more; } if ($command eq "laugh") { fallover; }