while (1) { # display the menu print $menu, "\n\n"; # get the user choice print "Make your choice: "; chomp($choice = lc ); # fulfill the user request if ($choice eq 'a'){ print "Enter a male name: "; chomp ($name1 = lc ); } if (exists $son_father{$name1}) { print "Duplicate name -- try again!\n"; } else { print "Add a father: "; chomp ($add_dad = lc ); $son_father{$name1} = {$add_dad}; } ... } # end while loop