use strict;
open(IN,'logfile.txt') or die("cannot open the log file for reading\n"+);
open(OUT,'>output.txt') or die("cannot open the output file for writin+g\n");######To create the output file
while(<IN>){######to read the input file
print OUT "$_" if($_=~/\bTWO\b/i);
}
close(IN);
close(OUT);