title: How do I find if it is the last line while reading a file from within a loop in perl
body: <p>I am working on a log parsing script using Perl. I am reading the log file as follows:</p>
  
  <pre><code>open(LOGFILE, "$logFile") || die "Error opening log file $logFile\n";                           
  while(&lt;LOGFILE&gt;) 
  {   
    #Processing statements goes here.
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>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?</p>