Provided by: libdatetime-format-builder-perl_0.8200-1_all bug

NAME

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

VERSION

       version 0.82

SYNOPSIS

           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 )],
                       },
                   ]
               }
           );

DESCRIPTION

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

SPECIFICATION

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

       •   "undef", meaning no groups could be found.

       •   An empty list, meaning no groups could be found.

       •   A single string, meaning: use this group

       •   A list of strings, meaning: use these groups in this order.

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

SIDE EFFECTS

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

SEE ALSO

       "datetime@perl.org" mailing list.

       http://datetime.perl.org/

       perl, DateTime, DateTime::Format::Builder

SUPPORT

       Bugs  may  be  submitted at <http://rt.cpan.org/Public/Dist/Display.html?Name=DateTime-Format-Builder> or
       via email to bug-datetime-format-builder@rt.cpan.org <mailto:bug-datetime-format-builder@rt.cpan.org>.

       I am also usually active on IRC as 'autarch' on "irc://irc.perl.org".

SOURCE

       The    source     code     repository     for     DateTime-Format-Builder     can     be     found     at
       <https://github.com/houseabsolute/DateTime-Format-Builder>.

AUTHORS

       •   Dave Rolsky <autarch@urth.org>

       •   Iain Truskett

COPYRIGHT AND LICENSE

       This software is Copyright (c) 2019 by Dave Rolsky.

       This is free software, licensed under:

         The Artistic License 2.0 (GPL Compatible)

       The full text of the license can be found in the LICENSE file included with this distribution.

perl v5.28.1                                       2019-07-22              DateTime::Form...arser::Dispatch(3pm)