print "Specify file to read.\n"; $file = <STDIN>; chomp $file; print "Identified file is $file\n"; print "Is this correct?\n"; $confirm = <STDIN>; 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 (<STDIN>) { #reads every line of file. if (/gateway/) { #HOW TO EXTRACT TO ANOTHER TXT FILE?
In reply to search and extract lines which contain a word by m@cky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |