Hello:
I am a beginer with perl and just trying different things. Here is my question where all you unselfish experts may be able to help.
I am going through a text file which has following contents:
2002-10-28 is today, 28-10-2001 was a year ago.
I want to verify that the date is valid. I wish to do the same for a few different formats such as:
Wednesday, November 6, 2002
November 6, 2002
06/11/02
06.11.2002
6 November 2002
6-Nov-02
(there are many more but once guided I think i should be able to get the rest)
Once verified I want to output this (simply into an output txt file):
<date>2002-10-28</date> is today, <date>28-10-2001</date> was a year ago.
Hope someone will be able to help me with this. Thank you again to everyone for any advice or help.
Vince
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.