#!/usr/bin/perl -w use strict; print "Please enter a filename to receive input from: \n"; chomp ( my $input_file = ); print "Now another file you would like output to go to: \n"; chomp ( my $output_file = ); menu { print " ***********************\n" . " * 1. Replace word. *\n" . " * 2. Replace string. *\n" . " * 3. Sort lines. *\n" . " * 4. Count words. *\n" . " * 5. Quit *\n" . " ***********************\n\n" . "Enter a choice: "; chomp(my $choice = ); SWITCH: { if($choice == 1) { replaceWord(); last SWITCH; } if($choice == 2) { replaceString(); last SWITCH; } if($choice == 3) { sortLines(); last SWITCH; } if($choice == 4) { countWords(); last SWITCH; } if($choice == 5) { die "Good bye!\n"; last SWITCH; } print "\nInvalid choice: $choice...\n\n"; } } sub replaceWord { () }