I am working on a log parsing script using Perl. I am reading the log file as follows:
open(LOGFILE, "$logFile") || die "Error opening log file $logFile\n";
while(<LOGFILE>)
{
#Processing statements goes here.
}
Now in processing statements I want to check if the file reading pointer is on the last line. if yes then want to process a condition before exiting.
So the question is from within the while loop which is being used to read the file line by line, How do I find out if it's on the last line?