|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re: Is there a way to read a file backwards?by jlp (Friar) |
| on Jul 31, 2000 at 03:55 UTC ( [id://25207]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
If you're not worried about memory consumption, you could just do:
my @reverse_lines = reverse <FH>; This will read the whole file into memory, and is thus not very memory efficient, but it is probably the simplest way to do what you want. UPDATE: Whoops, that'll teach me to not read closely enough; I just noticed you said you didn't want to read the whole file; sorry. :\
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||