Thank you in advance,
Little help please? I'd like this script to know whether there is text printed to FILE_LOG and if there is no text than do not open FILE_LOG just die or unlink (delete).
open FILE_LOG, ">", "error.log" or die $!;
$LOGFILE = "keeplogging.log";
open(LOGFILE) or die("Could not open log file.");
while (<LOGFILE>)
{
print FILE_LOG if /\bhard error\b/i;
}
close(LOGFILE);
close(FILE_LOG);
Little help please? I'd like this script to know whether there is text printed to FILE_LOG and if there is no text than do not open FILE_LOG just die or unlink (delete).
open FILE_LOG, ">", "error.log" or die $!;
$LOGFILE = "keeplogging.log";
open(LOGFILE) or die("Could not open log file.");
while (<LOGFILE>)
{
print FILE_LOG if /\bhard error\b/i;
}
close(LOGFILE);
close(FILE_LOG);