I'm rather new to Perl development and I've come across a situation where I think the use of some sort of regex might work, but I'm not very good with them yet, so I need a little help.

Here's the situation. I'm reading a list of appointments from an XML file and I'd like to remove any old dates from the file. Here's a sample of the XML to show you the schema:
<SCHEDULE> <DAY DATE="4/21/2001"> <APPT> <START>10:00</START> <STOP>11:00</STOP> </APPT> <APPT> <START>12:00</START> <STOP>13:30</STOP> </APPT> </DAY> <DAY> ... </DAY> ... </CALENDAR>
What I'd like to accompish is to read this file in (possibly into a single scalar, for simplicity) and remove all <DAY> nodes with a "DATE" attribute prior to a specific date, such as the current date.

I was thinking of using some permutation of the s/// operator to accomplish someting like:
$xmlDoc =~ s/<DATE DAY="(Everything less than today)"...</DATE>//g;
This is where I'm having trouble. Can I use some sort of regex to pull this off or is there possibly another, simpler way of accomplishing this.

Thanks,
- Sherlock

P.S.
I'd like to send a little "Thank you" out to OeufMayo for the XML::Parser Tutorial that really got me going on this project. ;-)

In reply to Will regex work here? by Sherlock

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.