Don't ask to ask, just ask | |
PerlMonks |
Reading a file line-by-line from the bottom upby fx (Pilgrim) |
on Jan 08, 2004 at 00:19 UTC ( [id://319669]=perlquestion: print w/replies, xml ) | Need Help?? |
fx has asked for the wisdom of the Perl Monks concerning the following question: Using:
I can read a file line-by-line from the top down. How would I go about reading it line-by-line from the bottom up? Under Linux I suppose it would be fairly easy to have my code read standard input and simply tac (like cat, but in reverse) the file into the script. However, I can't guarantee that tac will be available on all systems where this code will run and would therefore prefer to do it with Perl. The file in question is large (~600Mb) so I'd rather not read it into memory first :) Any ideas?
Back to
Seekers of Perl Wisdom
|
|