Yes, sorry; The date ranges can overlap each other. The search sub just returns when it find the first match of a date in any range.

My example should have shown this.

The ranges are more like this:

2018-03-05 06:00:00 -> 2018-03-06 01:00:00 2018-03-05 06:00:00 -> 2018-03-06 02:00:00 2018-03-05 06:00:00 -> 2018-03-06 03:00:00 2018-03-05 06:00:00 -> 2018-03-06 04:00:00 2018-03-05 06:00:00 -> 2018-03-06 05:00:00 2018-03-05 06:00:00 -> 2018-03-06 06:00:00 2018-03-06 06:00:00 -> 2018-03-06 07:00:00 2018-03-06 06:00:00 -> 2018-03-06 08:00:00 2018-03-06 06:00:00 -> 2018-03-06 10:00:00 2018-03-06 06:00:00 -> 2018-03-06 11:00:00 2018-03-06 06:00:00 -> 2018-03-06 12:00:00 2018-03-06 06:00:00 -> 2018-03-06 13:00:00

It is of operational assumption given the above set of ranges (notice 06:00 -> 09:00 is missing which happens often) that we are "normally" processing hour 13 (06:00 -> 14:00 but that is no guarantee ... (Around 6:30 am the log is rotated so the range stars over ...)

If my next load is from 08:00 -> 09:00 then I can skip loading the dates that are already loaded in the 06:00 -> 10:00 data set.

I know, complicated ...


In reply to Re^4: search through hash for date in a range by bfdi533
in thread search through hash for date in a range by bfdi533

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.