debian man page for path::dispatcher::rule::under

Query: path::dispatcher::rule::under

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Path::Dispatcher::Rule::Under(3pm)			User Contributed Perl Documentation			Path::Dispatcher::Rule::Under(3pm)

NAME
Path::Dispatcher::Rule::Under - rules under a predicate
SYNOPSIS
my $ticket = Path::Dispatcher::Rule::Tokens->new( tokens => [ 'ticket' ], prefix => 1, ); my $create = Path::Dispatcher::Rule::Tokens->new( tokens => [ 'create' ], block => sub { create_ticket() }, ); my $delete = Path::Dispatcher::Rule::Tokens->new( tokens => [ 'delete', qr/^d+$/ ], block => sub { delete_ticket(shift->pos(2)) }, ); my $rule = Path::Dispatcher::Rule::Under->new( predicate => $ticket, rules => [ $create, $delete ], ); $rule->match("ticket create"); $rule->match("ticket delete 3");
DESCRIPTION
Rules of this class have two-phase matching: if the predicate is matched, then the contained rules are matched. The benefit of this is less repetition of the predicate, both in terms of code and in matching it.
ATTRIBUTES
predicate A rule (which must match prefixes) whose match determines whether the contained rules are considered. The leftover path of the predicate is used as the path for the contained rules. rules A list of rules that will be try to be matched only if the predicate is matched. perl v5.12.4 2011-08-30 Path::Dispatcher::Rule::Under(3pm)
Related Man Pages
css::dom::rule(3pm) - debian
css::dom::rule::media(3pm) - debian
file::find::object::rule::procedural(3pm) - debian
path::dispatcher(3pm) - debian
path::dispatcher::match(3pm) - debian
Similar Topics in the Unix Linux Community
Path to become a linux geek...
Editing files
New Rule on Code Tags?
Career Path
Perl to update field based on a specific set of rules