in reply to simple loop

Smells a wee bit like homework, but try:
LOOP: { $choice = <STDIN>; 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 LOOP; } }



Code is (almost) always untested.
http://www.justicepoetic.net/