DateTim...Dispatch(3)
π¦ DateTim...Dispatch(3) β the dispatch parser one
okay so real talk, this is a User Contributed Perl Documentation page for DateTime::Format::Builder::Parser::Dispatch, and honestly? It's a whole vibe. Stay with me bestie, it's shorter than it looks π
β¨ NAME β¨
DateTime::Format::Builder::Parser::Dispatch β Dispatch parsers by group. That's it, that's the whole thing, and it ate π
πΈ VERSION πΈ
version 0.83
π SYNOPSIS π
like, just look at it. it's giving main character energy:
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 )],
},
]
}
);
no cap, 'fnerk' is literally a group name here and I'm obsessed π
π DESCRIPTION π
so Dispatch is out here adding another parser type to Builder, and what it does is permit dispatch of parsing according to group names. Slay. It's literally in the name, iykyk.
π₯ SPECIFICATION π₯
Dispatch has just one key: Dispatch. One key! Minimalist icon β¨
The value should be a reference to a subroutine, and that sub returns one of these four things:
undefβ meaning no groups could be found π- An empty list β also meaning no groups could be found (same energy, different shape π)
- 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 up in the SYNOPSIS. They follow the same format as when you specify them for methods. Fr fr, same format.
π SIDE EFFECTS π
bestie. listen. Your group parser can also be a Dispatch parser. Thus you could potentially end up with an infinitely recursive parser. Not me warning you dramatically, but likeβ¦ I am warning you dramatically π
π SEE ALSO π
- the
datetime@perl.orgmailing list π¬ - http://datetime.perl.org/ π¦
perl,DateTime,DateTime::Format::Builder
π«Ά 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. come say hi π
β SOURCE β
The source code repository for DateTime-Format-Builder can be found at https://github.com/houseabsolute/DateTime-Format-Builder. go peek, it's right there π
π AUTHORS π
- Dave Rolsky <autarch@urth.org>
- Iain Truskett <spoon@cpan.org>
two icons, one module π
πΈ COPYRIGHT AND LICENSE πΈ
This 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. read it, it's good for you π§
and that's the whole page bestie!! brought to you by perl v5.40.0, dated 2023-01-15, and the DateTim...Dispatch(3) girlies πβ¨ mwah, go parse something cute π¦
π¦ where this page comes from
- epel 10: perl-DateTime-Format-Builder 0.8300-9.el10_0 Β· Artistic-2.0 AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms