While I have been trying to figure out how to handle date validation, I have come to decide that regex isnt the answer and I just need a simple date validation script. I could use a module, but all the date validation modules that people have suggested required a small list of extra modules to install. Me being in-experienced with installing modules on a server I don't want to screw up doesn't help either. However, someone did suggest to me that "Time::Local" was a good easy "core" way to validate dates, but I haven't been able to find an example of how to go about doing that using Time::Local. If anyone has any past experience to making a quick validation script, that would be very helpful.

Basically all the script needs to do is accept input from variable $userdate and validate whether or not its valid. If its valid, great, do nothing, if its not valid set an error variable.

I haven't gotten anything to work using Time::Local so I'm sorry I can't show any good working code that could be edited.

In reply to Simple Date Validation by Trihedralguy

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.