print "Specify file to read.\n"; $file = ; chomp $file; print "Identified file is $file\n"; print "Is this correct?\n"; $confirm = ; chomp $confirm; if ($confirm eq "yes") { print "Commencing work on $file.\n"; workings (); } else { #WHAT NEXT? } ## Subroutine to open & read logfile sub workings { open (LOGFILE, $file); #Open & read specified file while () { #reads every line of file. if (/gateway/) { #HOW TO EXTRACT TO ANOTHER TXT FILE?