DateTime::Format::Builder::Parser::Dispatch(3pm)

DateTime::Format::Builder::Parser::Dispatch3pm

Dispatch parsers by group

Usage

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

Version

version 0.83

Overview

"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.

Support

Bugs may be submitted at <https://github.com/houseabsolute/DateTime-Format-Builder/issues>.

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>.

Releases

11 releases since Debian 4.0 (Etch); the text changed 6 times.

  1. 4.0
  2. 5.0–6.0
  3. 7
  4. 8–9
  5. 10
  6. 11–13
  7. Arch

Authors

•

Dave Rolsky <[email protected]>

•

Iain Truskett <[email protected]>

From perl-datetime-format-builder 1:0.83-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.