Says Chmrr:
Tie::File ... Pretty much as simple as it gets. Unfortunatly, it's not quite so hot on the performance:
Not too surprising, because unlike most of the methods you benchmarked, Tie::File does not read the file backwards. It reads it forwards, starting at the beginning, and constructs some data structures along the way. For a long file like /var/adm/messages, this will take some time, because it grovels over the entire file.

The payoff would come if you then asked it to tell you what was on line 12,345, which it would do instantly---or if you asked it to modify line 12,345, which the other modules won't do at all.

--
Mark Dominus
Perl Paraphernalia


In reply to Re: Performing a tail(1) in Perl (reading the last N lines of a file) by Dominus
in thread Performing a tail(1) in Perl (reading the last N lines of a file) by grinder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":