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


in reply to Read Some lines in Tera byte file

If the file doesn't get changed often and you have the ability to seek in it, then I would create an index of where every hundreth or thousand line starts, i.e where line 1000, line 2000, line 3000... starts. That way my index file would be relatively small and I would have to read maximal 99 or 999 unnecessary lines before reading the payload.

But as I said, this depends on the data being unchanging or only getting updated by appending