BrowserUk, I decided against using Date:Manip even though I really like that module. That's because the module instructions warn that it's slower than other time modules and this script will be used most often when the web server is overloaded with requests; thus, speed is essential.

Given you are doing a filesystem read between every call to Date::Manip, I seriously doubt it would be a bottleneck. In any case it would be running faster than your broken code:).

If you really find that Date::Manip is too slow for your application, then you could move to using one of the (several dozen) Date::* modules on CPAN rather than attempting to roll your own. Several of these are mentioned in the Date::Manip pod: Date::Parser, Date::Calc. The later of which is an interface to a C library I believe and its reputedly very fast. The main reason I didn't suggest these is that you need to compile them which is sometimes a problem.

A quick look at your code and its glaringly obvious what the problem is. And if you hadn't commented out the use strict and omitted the -w/use warnings it would be glaringly obvious to you too, as the compiler would be screaming the cause at you over and over. 11 times I think.

Come back, if you need to, once you have made your code compile cleanly with -w and use strict and you might get some further help.


Examine what is said, not who speaks.


In reply to Re: Pulling by regex II by BrowserUk
in thread Pulling by regex II by mkent

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.