I am working on a log log analysis using Perl. I am reading the log file as follows:
open(LOGFILE, "$logFile") || die "Error opening log file $logFile\n";
while(<LOGFILE>)
{
}
Now in the handlers I want to check if the file read pointer is on the last line. if so, then you want to process the condition before exiting.
So, the question arises from the while loop, which is used to read the file line by line. How to find out if it is in the last line?
source
share