title: Need to print the last occurrence of a string in Perl
body: <p>I have a script in Perl that searches for an error that is in a config file, but it prints out any occurrence of the error.  I need to match what is in the config file and print out only the last time the error occurred.  Any ideas?</p>
  
  <hr>
  
  <p>Wow...I was not expecting this much of a response. I should've been more clear in stating this is for log monitoring on a windows box that sends an alert to Nagios. This is actually my first Perl program and all this information has been very helpful. Does anyone know how I can apply this any of the tail answers on a wintel box?</p>