initialize_variables(); my $is_time_to_exit = 0; while (! $is_time_to_exit) { my $choice = choose_menu_item(); if ($choice eq 'a') { add_son_father_pair(); } elsif ($choice eq 'd') { delete_son_father_pair(); } elsif ($choice eq 'e') { $is_time_to_exit = 1; } elsif ($choice eq 'g') { get_a_father(); } elsif ($choice eq 'o') { output_hash_neatly(); } elsif ($choice eq 'r') { replace_a_father(); } elsif ($choice eq 'x') { get_a_grandfather(); } else { print "Invalid choice, TRY AGAIN!\n"; } } print "Come back again -- goodbye!";