Perl grep inside of an if clause?

hops

New member
I have the following in my perl script to run on Windows servers:
IN and OUT being part of the open commands to open the files.

if (grep(/Export terminated successfully without warnings./, <IN>)) {
print "SUCCESS IT WORKS";
} else {
$errorfound="T";
print OUT "The export has not finished yet\n";
}

The problem is that when I run the script it always goes into the else statement even if the file has the 'Export terminated successfully without warnings.' line. Am I botching what I am passing into grep (i.e. the regex) or is my logic wrong on the if statement? Thanks.
 
Back
Top