in reply to Re: Re: Simulating UNIX's "tail" in core Perl
in thread Simulating UNIX's "tail" in core Perl

It won't.

There are no shortcuts for finding the 1027th line of a text file containing arbitrary lines of arbitrary length. Now, if you want the last 100 lines, then seek can be a very effective short cut.

If the lines are of fixed length or you can identify the desired lines by something other than sequence (for example, if the text of the lines contain line numbers), then you can probably come up with shortcuts that don't involve just reading all of the lines and looking for and counting the newlines.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: Simulating UNIX's "tail" in core Perl