Due to the date format you are using it is not always possible to get a correct truth value. If you have the date Dec 31. You may not throw it out correctly. Say you check the date Dec 31 on Jan 1, you algorithm would show a date distance of 1 day, but maybe these are more than 1 day apart (i.e. Dec 31 1942 and Jan 1 2005) you have no way of knowing since year is not listed in your log files. What is writing these log files? If you are I suggest reformatting them properly, and then taking a look at The DateTime Module

Also for deleting lines from the file.. you can't "technically" do that.. you can blank out lines but it will still be left as blank. You should open a new filehandle and write to it the things that pass your 90 day test.


Grygonos

In reply to Re: Dates! Log Files! Help! by Grygonos
in thread Dates! Log Files! Help! by rementis

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.