This is what I have so far...
open (OUTPUT, ">Results.txt") || die ("Could not open file results.txt; $OS_ERROR");
open( INFILE, "Textfile.txt" )or die("Can not open input file: $!");
while (<INFILE>) {
if ($ARG =~ /Something/ ) {
print OUTPUT $ARG ;
}
}
close (OUTPUT);