in reply to truncating a text file

What does your current code look like? You may like to mock up a test script using a __DATA__ section to simulate the "input data" for the script.

How you solve the problem depends a lot on whether you must parse the existing HTML document to determine what past lines were, or if you have them available in some other fashion and can simply recreate the HTML file with the new data.

HTML::TreeBuilder will help a lot if you have to parse the data and HTML::Template will help generate the new file. At some point an array slice (see perldata - slices) will help extract the last five lines.


DWIM is Perl's answer to Gödel