![]() |
|
No such thing as a small change | |
PerlMonks |
Re: Is there a way to read a file backwards?by jlp (Friar) |
on Jul 31, 2000 at 07:55 UTC ( #25207=note: print w/replies, xml ) | Need Help?? |
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
|
|