Here's an orthogonal idea: when you excerpt the file, store the results backwards. Then you can delete oldest by truncating the file.

In reply to Re: Removing old records from log files by John M. Dlugosz
in thread Removing old records from log files by claree0

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":