M
Miles
Looking for some help please.
Im using "Shell" to tail a logfile into a $Variable - but my logfiles
rotate, so an empty file might get called in... which I need to check for.
use Shell;
$lastlines = tail(-n $linestoread, $filename);
if ($lastlines == "") {
"Print - Says, the current logfile appears to be EMPTY (logs are
rotated at midnight!)\r\n|");
} else {
"Print - Says, these are the last $linestoread lines I have
logged: \r\n" .
"$lastlines|");
}
If log is empty, then $lastlines returns zero and the first command works
ok.
But if log is full, then $lastlines > zero, and I get errors.
_quote_
" isn't numeric in numeric eq (==) at
/home/testing/scripts/logger.pl line 87.
_unquote_
This is probably an easy one, but any assistance is appreciated.
Cheers,
Miles
n00b !
Im using "Shell" to tail a logfile into a $Variable - but my logfiles
rotate, so an empty file might get called in... which I need to check for.
use Shell;
$lastlines = tail(-n $linestoread, $filename);
if ($lastlines == "") {
"Print - Says, the current logfile appears to be EMPTY (logs are
rotated at midnight!)\r\n|");
} else {
"Print - Says, these are the last $linestoread lines I have
logged: \r\n" .
"$lastlines|");
}
If log is empty, then $lastlines returns zero and the first command works
ok.
But if log is full, then $lastlines > zero, and I get errors.
_quote_
" isn't numeric in numeric eq (==) at
/home/testing/scripts/logger.pl line 87.
_unquote_
This is probably an easy one, but any assistance is appreciated.
Cheers,
Miles
n00b !