1DateTime::Format::BuildUesre:r:PCaornsterriD:ba:utDteieTsdipmaPete:cr:hlF(o3Dr)omcautm:e:nBtuaitlidoenr::Parser::Dispatch(3)
2
3
4

NAME

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

SYNOPSIS

9           package SampleDispatch;
10           use DateTime::Format::Builder
11           (
12               parsers => {
13                   parse_datetime => [
14                       {
15                           Dispatch => sub {
16                               return 'fnerk';
17                           }
18                       }
19                   ]
20               },
21               groups => {
22                   fnerk => [
23                       {
24                           regex => qr/^(\d{4})(\d\d)(\d\d)$/,
25                           params => [qw( year month day )],
26                       },
27                   ]
28               }
29           );
30

DESCRIPTION

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

SPECIFICATION

36       "Dispatch" has just one key: "Dispatch". The value should be a refer‐
37       ence to a subroutine that returns one of:
38
39       ·   "undef", meaning no groups could be found.
40
41       ·   An empty list, meaning no groups could be found.
42
43       ·   A single string, meaning: use this group
44
45       ·   A list of strings, meaning: use these groups in this order.
46
47       Groups are specified much like the example in the SYNOPSIS.  They fol‐
48       low the same format as when you specify them for methods.
49

SIDEEFFECTS

51       Your group parser can also be a Dispatch parser. Thus you could poten‐
52       tially end up with an infinitely recursive parser.
53

THANKS

55       See the main module's section.
56

SUPPORT

58       Support for this module is provided via the datetime@perl.org email
59       list. See http://lists.perl.org/ for more details.
60
61       Alternatively, log them via the CPAN RT system via the web or email:
62
63           http://perl.dellah.org/rt/dtbuilder
64           bug-datetime-format-builder@rt.cpan.org
65
66       This makes it much easier for me to track things and thus means your
67       problem is less likely to be neglected.
68
70       Copyright (C) Iain Truskett, 2003. All rights reserved.
71
72       This library is free software; you can redistribute it and/or modify it
73       under the same terms as Perl itself, either Perl version 5.000 or, at
74       your option, any later version of Perl 5 you may have available.
75
76       The full text of the licences can be found in the Artistic and COPYING
77       files included with this module, or in perlartistic and perlgpl as sup‐
78       plied with Perl 5.8.1 and later.
79

AUTHOR

81       Iain Truskett <spoon@cpan.org>
82

SEE ALSO

84       "datetime@perl.org" mailing list.
85
86       http://datetime.perl.org/
87
88       perl, DateTime, DateTime::Format::Builder
89
90
91
92perl v5.8.8                     Da2t0e0T8i-m0e2:-:0F1ormat::Builder::Parser::Dispatch(3)
Impressum