I know very little about Perl, I picked up a book hoping to teach myself.
Here’s what I would like this Perl program to do.
At 9:00am and 9:00pm to change directory to c:\modems delete the file failure.txt. Now open/read any file with the extension .log there will be sub directories. In these log files search for the word “Failure”. If it finds the word Failure print the name of the file it found the word failure in to c:\modem\failure.txt
Here’s what I have been able to do so far.
$target = "Failure";
open(INPUT, "<HAYES.LOG"
while (<INPUT>) {
if (/$target/) {
print "HAYES";
}
}
close(INPUT);
This program prints the result to the screen and not a file.
Any help would be gratefully appreciated.
Here’s what I would like this Perl program to do.
At 9:00am and 9:00pm to change directory to c:\modems delete the file failure.txt. Now open/read any file with the extension .log there will be sub directories. In these log files search for the word “Failure”. If it finds the word Failure print the name of the file it found the word failure in to c:\modem\failure.txt
Here’s what I have been able to do so far.
$target = "Failure";
open(INPUT, "<HAYES.LOG"
while (<INPUT>) {
if (/$target/) {
print "HAYES";
}
}
close(INPUT);
This program prints the result to the screen and not a file.
Any help would be gratefully appreciated.