Use File::ReadBackwards to read the lines of the file and then stop at the first match.
use File::ReadBackwards; tie *BW, 'File::ReadBackwards', 'file' or die "can't read 'file' $!"; while ( <BW> ) { if ( /pattern/ ) { print; last; } }
In reply to Re: Matching Regular expression at EOF
by jwkrahn
in thread Matching Regular expression at EOF
by krish28
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |