{ chomp (my $choice = ); if (exists $codehash{$choice}) { &{$codehash{$choice}}; } else { print "ERROR: Please type in either 1, 2 or 3.\n"; redo; } }