print "Specify full directory of logfile.\n"; $file = ; chomp $file; print "\nIdentified file is $file\n"; print "Is this correct? (y/n)\n"; $confirm = ; chomp $confirm; if ($confirm eq "y") { print "\nCommencing work on $file.\n"; workings(); } else { print "Terminating program...\n"; } ## Subroutine to open & read logfile sub workings { print"In Subroutine workings now.\n"; open (LOGFILE, $file); print "Opening logfile...\n"; open (OUT, ">>", 'D:\Temp\test.txt') or die "$!"; print "Opening output file...\n"; print "Checking for string GATEWAY...\n"; while () { if (/gateway/) { $count = $count + 1; print OUT; print "Extracting line ...\n"; } elsif (/TIMESTAMP/) { $count = $count + 1; print OUT; print "Extracting line ...\n"; } } print "\nTotal of $count lines extracted.\n"; close OUT; close LOGFILE; } ##Array to contain usernames @names = qw(mddinzam khairulz sawaikha caoyx jchew khamshae hartinib teev xiaolh yettynm yussofyu leegm narayam karuppa doraira edanor razaliha sambanr jwong lamks linwb rashid ongsp ooisc mohdrosn);