Added to the FAQ.
Thanks!
-ben
On Thu, Jul 17, 2003 at 03:53:57PM +1000, Iain Truskett wrote:
> * Hill, Ronald ([EMAIL PROTECTED]) [15 Jul 2003 02:57]:
> > Hi John & Iain
>
> > > On Sunday, July 13, 2003, at 08:11 PM, Iain Truskett wrote:
> > > > Remember: part of the point of having the various format
> > > > modules is that you can pick'n'mix. You could conceivably
> > > > wrap a number of them in Builder to make your own parser
> > > > that recognizes the sorts of dates you come across. I mostly
>
> > I think an example of this type of thing needs to go into the
> > FAQ. Do you have an example of doing this?
>
> #!/usr/bin/perl -w
> use strict;
>
> package DateTime::Format::Fall;
> use DateTime::Format::HTTP;
> use DateTime::Format::Mail;
> use DateTime::Format::IBeat;
>
> use DateTime::Format::Builder (
> parsers => { parse_datetime => [
> sub { eval { DateTime::Format::HTTP->parse_datetime( $_[1] ) } },
> sub { eval { DateTime::Format::Mail->parse_datetime( $_[1] ) } },
> sub { eval { DateTime::Format::IBeat->parse_datetime( $_[1] ) } },
> ] });
>
> package main;
>
> for ( '@d19.07.03 @704', '20030719T155345', 'gibberish' )
> {
> print DateTime::Format::Fall->parse_datetime($_)->datetime, "\n";
> }
> __END__
>
> cheers,
> --
> Iain.