GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DATETIME::FORMAT::BUILDER::PARSER::DISPATCH (3)

.ds Aq ’

NAME

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

CONTENTS

VERSION

version 0.81

SYNOPSIS



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



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:
o undef, meaning no groups could be found.
o An empty list, meaning no groups could be found.
o A single string, meaning: use this group
o 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.

SIDEEFFECTS

Your group parser can also be a Dispatch parser. Thus you could potentially end up with an infinitely recursive parser.

SUPPORT

See DateTime::Format::Builder for details.

SEE ALSO

datetime@perl.org mailing list.

http://datetime.perl.org/

perl, DateTime, DateTime::Format::Builder

AUTHORS

o Dave Rolsky <autarch@urth.org>
o Iain Truskett

COPYRIGHT AND LICENSE

This software is Copyright (c) 2013 by Dave Rolsky.

This is free software, licensed under:



  The Artistic License 2.0 (GPL Compatible)



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DATETIME::FORMAT::BUILDER::PARSER::DISPATCH (3) 2013-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.