<?xml version="1.0" encoding="windows-1252"?>
<node id="106904" title="Removing old records from log files" created="2001-08-22 09:49:57" updated="2005-07-19 14:08:39">
<type id="115">
perlquestion</type>
<author id="77273">
claree0</author>
<data>
<field name="doctext">
&lt;p&gt;I'm currently performing a lot of manipulation of log files, which grow by up to 100MB/day. The records in the files are of the format 

&lt;code&gt;
date/time logentry
&lt;/code&gt;

&lt;p&gt;and I want to be able to trim out the older records. Currently, I do this by reading the file line-by-line, and writing out the lines after $arbitrary_data to a temporary file, which is then used to replace the current log file.

&lt;p&gt;This takes a considerable amount of time to process, so any suggestions for a more efficient method would be very gratefully received.</field>
</data>
</node>
