s/([,;"])/\\$1/gs/([\n])/\\n/gBEGIN:VCALENDAR METHOD:PUBLISH PRODID:-//Apple Computer\, Inc//iCal 1.0//EN VERSION:2.0 BEGIN:VEVENT SEQUENCE:1 DTSTAMP:<$MTEntryDate format="%Y%m%dT%H%M%S"$>Z SUMMARY:COM: <$MTEntryTitle regex="iCal" remove_html="1" $> DESCRIPTION:<$MTEntryBody regex="iCal iCalReturn" remove_html="1" $> DTSTART: use Time::Local; my $mytime = timelocal(<$MTEntryDate format="('%S', '%M', '%H', '%e', '%m'-1, '%Y'-1900)"$>); $mytime = $mytime + 3600; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=gmtime($mytime); printf('%d%02d%02dT%02d%02d%02dZ',$year+1900,$mon+1,$mday,$hour,$min,$sec); DTEND: use Time::Local; my $mytime = timelocal(<$MTEntryDate format="('%S', '%M', '%H', '%e', '%m'-1, '%Y'-1900)"$>); $mytime = $mytime + 3600; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=gmtime($mytime); printf('%d%02d%02dT%02d%02d%02dZ',$year+1900,$mon+1,$mday,$hour,$min,$sec); STATUS:CONFIRMED CLASS:PUBLIC UID:<$MTEntryID> DURATION:PT1H END:VEVENT END:VCALENDAR