With the other homework queries I have recently posted I was at least able to write much of my own code, and then ask everyone for clues to bring me along, but the current problem has me completely flummoxed. Maybe I shouldn't work on this stuff at midnight...I have been pondering on this for a few days now though.

I will present the problem, but first I want to say that what I am looking for here is procedural/flowcharty kind of help...no code yet, as I need to start the dang thing on my own. Just some possible unflummoxment if you please.

I need to write a script which will convert dates. I can do that already...date format a in, date format b out. Where this assignment leaves me behind is in the fact that it needs to be able to read date formats as follows - Apr 8 1984, Apr 08 84, 4/8/84, 04/08/84, and 08 Apr 1984. The output then needs to be of one format.

It will read in the various format dates, but then it needs to be able to parse each piece of the different style dates and understand which piece is which in order to relate them to the output format.

One thought I had early on was to ask the user to select which format they are going to input, take their date, and then take care of it with one of a set of subroutines. Gets the job done, but kinda feels like a copout...of course trying to do it any other way may be well beyond my current Perl abilities.

Anyhow - I humbly seek some input, and suggestions...but no code (yet) please. Thanks!

In reply to More date conversion happiness by ctp

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.