while (1) { chomp(my $choice = ); if ($choice == 1) { &hash1; } elsif ($choice == 2) { &hash2; } elsif ($choice == 3) { &hash3; } else { print "ERROR: Please type in either 1, 2 or 3.\n"; redo; } last; }