while (($alive) and ($playing)) { $input = ; chomp($input); my @part = split(/\s+/, $input, 2); if (defined($actions{$part[0]})) { &handle_action(\@part, \$playing, \$alive); } else { print "Huh?\n"; } }