Rechercher une page de manuel
Path::Dispatcher::Dispatch.3pm
Langue: en
Version: 2009-12-31 (ubuntu - 24/10/10)
Section: 3 (Bibliothèques de fonctions)
NAME
Path::Dispatcher::Dispatch - a list of matchesSYNOPSIS
my $dispatcher = Path::Dispatcher->new( rules => [ Path::Dispatcher::Rule::Tokens->new( tokens => [ 'attack', qr/^\w+$/ ], block => sub { attack($2) }, ), ], ); my $dispatch = $dispatcher->dispatch("attack goblin"); $dispatch->matches; # list of matches (in this case, one) $dispatch->has_matches; # whether there were any matches $dispatch->run; # attacks the goblin
DESCRIPTION
Dispatching creates a "dispatch" which is little more than a (possibly empty!) list of matches.ATTRIBUTES
matches
The list of Path::Dispatcher::Match that correspond to the rules that were matched.METHODS
run
Executes the first match.Each match's ``run'' in Path::Dispatcher::Match method is evaluated in scalar context. The return value of this method is a list of these scalars (or the first if called in scalar context).
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre