Date: | Mon, 24 Nov 2003 18:57:22 -1000 (HST) |
From: | Joshua Hoblitt <jhoblitt [...] ifa.hawaii.edu> |
To: | "Iain 'Spoon' Truskett" <spoon [...] cpan.org> |
Subject: | DT::F::Builder Dispatch bug? |
Hi Iain,
Did I miss something or is this a bug?
-J
--
#!/usr/bin/perl
use strict;
use warnings;
package testDispatch;
use DateTime::Format::Builder;
DateTime::Format::Builder->create_class(
parsers => {
parse_datetime => [
{
Dispatch => sub {
return( 8, 6 );
}
},
],
},
groups => {
8 => [
{
regex => qr/^ (\d{4}) (\d\d) (\d\d) $/x,
params => [ qw( year month day ) ],
},
],
6 => [
{
regex => qr/^ (\d{4}) (\d\d) $/x,
params => [ qw( year month ) ],
},
],
}
);
package main;
my $dt = testDispatch->parse_datetime( 200311 );
print $dt->iso8601;