Dear monks,

I'm currently struggling with a script that can parse iCalendar files and attachments in order to extract the useful information in a terse way and in it's God-given text form.

All was fine and dandy (I'm using Data::ICal and it works acceptably), until I ran into recurring events and the endless fun that lies in paragraph 4.8.5.4 of RFC2445. I have to admit this requires more intelligence that I'm prepared to sink in this so I really need some guidance, especially since I haven't found (yet) any modules that tackle this issue.

The only implementation I found so far is Google's, made in Java, but I'm not too keen to look at it because:

What I would like to obtain is something along the lines of "given a recurrence rule and a date, what's the next/previous instance of the recurring event?". I currently do this by some weird contraption looking for known rule patterns, but I'd much rather use a more advanced method.

P.S.: What makes it even worse is the "surely this has been attempted before" sensation, coupled with the utter lack of battle signs, victories, scars, or bodies lying across the related Google/CPAN/PM searches.


In reply to RFC 2445 recurrence rule parsing by rpetre

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.