|
NAMEDateTime::Format::Builder::Parser::Dispatch - Dispatch parsers by groupVERSIONversion 0.83SYNOPSISpackage 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:
Groups are specified much like the example in the SYNOPSIS. They follow the same format as when you specify them for methods. SIDE EFFECTSYour 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 SUPPORTBugs 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". SOURCEThe source code repository for DateTime-Format-Builder can be found at <https://github.com/houseabsolute/DateTime-Format-Builder>.AUTHORS
COPYRIGHT AND LICENSEThis software is Copyright (c) 2020 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.
Visit the GSP FreeBSD Man Page Interface. |