http://www.perlmonks.org?node_id=520178


in reply to Display last record

Just move the file pointer to the end of the file minus whatever the maximum record size is, then read everything to the end of the file and extract the last record. This should be quite efficient even with huge files.