{
    "mode": "perldoc",
    "parameter": "DateTime::Format::Builder::Parser::Dispatch",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/DateTime%3A%3AFormat%3A%3ABuilder%3A%3AParser%3A%3ADispatch/json",
    "generated": "2026-06-09T11:56:09Z",
    "synopsis": "package SampleDispatch;\nuse DateTime::Format::Builder (\nparsers => {\nparsedatetime => [\n{\nDispatch => sub {\nreturn 'fnerk';\n}\n}\n]\n},\ngroups => {\nfnerk => [\n{\nregex  => qr/^(\\d{4})(\\d\\d)(\\d\\d)$/,\nparams => [qw( year month day )],\n},\n]\n}\n);",
    "sections": {
        "NAME": {
            "content": "DateTime::Format::Builder::Parser::Dispatch - Dispatch parsers by group\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 0.83\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "package SampleDispatch;\nuse DateTime::Format::Builder (\nparsers => {\nparsedatetime => [\n{\nDispatch => sub {\nreturn 'fnerk';\n}\n}\n]\n},\ngroups => {\nfnerk => [\n{\nregex  => qr/^(\\d{4})(\\d\\d)(\\d\\d)$/,\nparams => [qw( year month day )],\n},\n]\n}\n);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"Dispatch\" adds another parser type to \"Builder\" permitting dispatch of parsing according to\ngroup names.\n",
            "subsections": []
        },
        "SPECIFICATION": {
            "content": "\"Dispatch\" has just one key: \"Dispatch\". The value should be a reference to a subroutine that\nreturns one of:\n\n*   \"undef\", meaning no groups could be found.\n\n*   An empty list, meaning no groups could be found.\n\n*   A single string, meaning: use this group\n\n*   A list of strings, meaning: use these groups in this order.\n\nGroups are specified much like the example in the SYNOPSIS. They follow the same format as when\nyou specify them for methods.\n",
            "subsections": []
        },
        "SIDE EFFECTS": {
            "content": "Your group parser can also be a Dispatch parser. Thus you could potentially end up with an\ninfinitely recursive parser.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "\"datetime@perl.org\" mailing list.\n\nhttp://datetime.perl.org/\n\nperl, DateTime, DateTime::Format::Builder\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs may be submitted at <https://github.com/houseabsolute/DateTime-Format-Builder/issues>.\n\nI am also usually active on IRC as 'autarch' on \"irc://irc.perl.org\".\n",
            "subsections": []
        },
        "SOURCE": {
            "content": "The source code repository for DateTime-Format-Builder can be found at\n<https://github.com/houseabsolute/DateTime-Format-Builder>.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   Dave Rolsky <autarch@urth.org>\n\n*   Iain Truskett <spoon@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is Copyright (c) 2020 by Dave Rolsky.\n\nThis is free software, licensed under:\n\nThe Artistic License 2.0 (GPL Compatible)\n\nThe full text of the license can be found in the LICENSE file included with this distribution.\n",
            "subsections": []
        }
    },
    "summary": "DateTime::Format::Builder::Parser::Dispatch - Dispatch parsers by group",
    "flags": [],
    "examples": [],
    "see_also": []
}