I've used Date::Manip on several scripts before without any problems, but have discovered some random errors in my current project.

I've created a web app (linux/apache2 server) using Date::Manip. When I first installed the module on this server, I set the TZ variable inside the module (like I've always done before) but would receive random Date::Manip errors related to the TZ variable. So I manually set it inside my app...strange, but worked fine. Now I'm randomly getting errors on my date inputs. According to the documentation, input can be any of the following:

MM/DD MM/DD/YY MM/DD/YYYY mmmDD DDmmm mmmYYYY/DD mmmYYYY mmmDD/YY DDmmmYY DD/YYmmm YYYYmmmDD YYYYmmm mmmDDYYYY DDmmmYYYY DDYYYYmmm YYYY/DDmmm

However...periodically, I receive errors if I use any format other than MM/DD/YYYY. This error is if I use MM/DD:

ERROR: Invalid year () at /usr/local/share/perl/5.8.8/Date/Manip.pm l +ine 5538 Date::Manip::_Date_FixYear('undef') called at /usr/local/share +/perl/5.8.8/Date/Manip.pm line 5506 Date::Manip::_Date_DateCheck('SCALAR(0x9735474)', 'SCALAR(0x97 +32134)', 'SCALAR(0x97323f8)', 'SCALAR(0x97325b4)', 'SCALAR(0x973545c) +', 'SCALAR(0x973536c)', 'SCALAR(0x973220c)', 'SCALAR(0x9735570)') cal +led at /usr/local/share/perl/5.8.8/Date/Manip.pm line 1451 Date::Manip::ParseDateString('9/2') called at /usr/local/share +/perl/5.8.8/Date/Manip.pm line 1809

or (using mm/dd/yy)

ERROR: Invalid year (8) at /usr/local/share/perl/5.8.8/Date/Manip.pm +line 5538 Date::Manip::_Date_FixYear(8) called at /usr/local/share/perl/ +5.8.8/Date/Manip.pm line 3413 Date::Manip::Date_LeapYear(8) called at /usr/local/share/perl/ +5.8.8/Date/Manip.pm line 5508 Date::Manip::_Date_DateCheck('SCALAR(0xac88b28)', 'SCALAR(0xac +88b58)', 'SCALAR(0xac88aec)', 'SCALAR(0xabe90b0)', 'SCALAR(0xabe8fc0) +', 'SCALAR(0xabeb1e4)', 'SCALAR(0xabebb2c)', 'SCALAR(0xa43da34)') cal +led at /usr/local/share/perl/5.8.8/Date/Manip.pm line 1451 Date::Manip::ParseDateString('9/1/08') called at /usr/local/sh +are/perl/5.8.8/Date/Manip.pm line 1809

Here's the clincher: if I reload apache2, it fixes the problem, but only temporarily (maybe an hour or 2) so I doubt it's an error w/the code (I can include it if someone REALLY wants to see it...). Are there any Date::Manip or apache experts out there that have any ideas?


In reply to obscure/random input Date::Manip errors by ksublondie

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.