DateTime::Format::Builder::Parser::Dispatch - Dispatch parsers by group


DateTime::Format::Builder::Parser::Dispatch - Dispatch parsers by group


    package SampleDispatch;
    use DateTime::Format::Builder
        parsers => {
            parse_datetime => [
                    Dispatch => sub {
                        return 'fnerk';
        groups => {
            fnerk => [
                    regex => qr/^(\d{4})(\d\d)(\d\d)$/,
                    params => [qw( year month day )],


Dispatch adds another parser type to Builder permitting dispatch of parsing according to group names.


Dispatch has just one key: Dispatch. The value should be a reference to a subroutine that returns one of:

Groups are specified much like the example in the SYNOPSIS. They follow the same format as when you specify them for methods.


Your group parser can also be a Dispatch parser. Thus you could potentially end up with an infinitely recursive parser.


See the main module's section.


Support for this module is provided via the email list. See for more details.

Alternatively, log them via the CPAN RT system via the web or email:

This makes it much easier for me to track things and thus means your problem is less likely to be neglected.


Copyright © Iain Truskett, 2003. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.000 or, at your option, any later version of Perl 5 you may have available.

The full text of the licences can be found in the Artistic and COPYING files included with this module, or in the perlartistic manpage and the perlgpl manpage as supplied with Perl 5.8.1 and later.


Iain Truskett <>

SEE ALSO mailing list.

the perl manpage, DateTime, the DateTime::Format::Builder manpage

 DateTime::Format::Builder::Parser::Dispatch - Dispatch parsers by group