Path::...spatch(3pm)
π Path::...spatch β the manual, bestie edition π
okay so you're in the Path::Dispatcher docs (that's the Path::...spatch(3pm) situation, from User Contributed Perl Documentation), and honestly? slay. let's get into it. β¨
πΈ NAME πΈ
Path::Dispatcher::Dispatch β literally just a list of matches. that's it. that's the whole vibe. π
π VERSION π
version 1.08 β periodt. π
π¦ SYNOPSIS π¦
here's the tea, copy it exactly bestie:
my $dispatcher = Path::Dispatcher->new(
rules => [
Path::Dispatcher::Rule::Tokens->new(
tokens => [ 'attack', qr/^\w+$/ ],
block => sub { attack(shift->pos(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
not me writing a whole dispatcher just to attack a goblin π but likeβ¦ it works. it ate.
π DESCRIPTION π
so when you dispatch, you get a "dispatch" back, and a dispatch is little more than a list of matches. and yes bestie β possibly empty! π the list can be empty. that's a real possibility. no cap.
π ATTRIBUTES π
β matches
the list of Path::Dispatcher::Match that correspond to the rules that were matched. that's your roster. your main characters. your matched set. π«Ά
β¨ METHODS β¨
π₯ run
executes the first match. like, the first one. not all of them. the first. okay? okay. π
each match's "run" in Path::Dispatcher::Match method gets evaluated in scalar context. the return value of this method is a list of these scalars β or the first one if you called it in scalar context. iykyk. π
π§ SUPPORT π§
bugs may be submitted through the RT bug tracker at:
https://rt.cpan.org/Public/Dist/Display.html?Name=Path-Dispatcher
or you can email bug-Path-Dispatcher@rt.cpan.org β do it, bestie, they wanna hear from you. π
π AUTHOR π
Shawn M Moore, "<sartak at bestpractical.com>" β iconic behavior fr fr. π
πΈ COPYRIGHT AND LICENSE πΈ
this software is copyright (c) 2020 by Shawn M Moore.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so likeβ¦ go off. π
and that's the whole page, bestie π«Ά this doc came from perl v5.30.3, dated 2020-07-13, and it's the Path::...spatch(3pm) page β love that for us. mwah. πβ¨
π¦ where this page comes from
- debian bookworm: libpath-dispatcher-perl 1.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpath-dispatcher-perl 1.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libpath-dispatcher-perl 1.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpath-dispatcher-perl 1.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpath-dispatcher-perl 1.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpath-dispatcher-perl 1.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms