PDA

View Full Version : How can I take data from the end of a File?


Cartmants
07-14-2005, 02:51 PM
I am working on a script where I am building a news webpage. The main webpage with have the last 5 or so news items up and they will auto update once a new article is published. The way that Perl/CGI grabs the data is from the top lines. I have them delimeted by a pipe | and each article date and subject are one one line (Date is the Unix timestamp). I was wondering if anyone had an idea how to grab the data at the end of the file or how to add the newest data at the top of the text file, not at the bottom.

Thanks,

Tim

FishMonger
07-14-2005, 04:39 PM
http://search.cpan.org/~mjd/Tie-File-0.96/lib/Tie/File.pm
or
http://search.cpan.org/~uri/File-ReadBackwards-1.04/ReadBackwards.pm
or
http://search.cpan.org/~cwest/ppt-0.14/bin/tail
http://search.cpan.org/~mgrabnar/File-Tail-0.99.1/Tail.pm

Cartmants
07-14-2005, 04:56 PM
http://search.cpan.org/~mjd/Tie-File-0.96/lib/Tie/File.pm
or
http://search.cpan.org/~uri/File-ReadBackwards-1.04/ReadBackwards.pm
or
http://search.cpan.org/~cwest/ppt-0.14/bin/tail
http://search.cpan.org/~mgrabnar/File-Tail-0.99.1/Tail.pm


Thanks! I'm new to perl...and I think these will help out!

--Tim