use strict; use warnings; my $lastFound = -1; # No match value $| = 1; /\ba\b/ and ($lastFound = tell DATA) while ; print "No match \n" and exit if $lastFound == -1; seek DATA, $lastFound, 0; print ; __DATA__ Hi, I've seen a few similar problems to this posted here recently but none of them cover what I need to do and my Perl isn't strong enough yet for me to figure out how to do this. I'm parsing a number of text files (can range in size from 1K upto 100M) where the record size of each line is variable. I need to find (or seek to ?) the last occurence of a pattern then apply some further parsing logic from that point on until the end of file. What I do now (which doesn't cope with the problem) is: