Dancer2...::Route(3)
β¨ Dancer2::Core::Route β the manual page, but make it fashion β¨
okay bestie, gather round π this is the docs for Dancer2::Core::Route, which ships as Dancer2...::Route(3) in the perl manual pages. It's Dancer2's route handler β the lil object that knows what a route is and does the matching for you. No cap.
Version: 2.2.1 π
π¦ ATTRIBUTES π¦
These are the things a route carries around with it, like accessories but for code. π
methodβ the HTTP method of the route, and it's lowercase bestie, we do not shout. Required. π¨codeβ the code reference that gets executed when the route is ran. Required. This is the main character of the whole operation fr.regexpβ the regular expression that defines the path of the route. Required. It gets coerced from Dancer2's route patterns, so you don't have to hand-write the regex yourself. slay.prefixβ the prefix to prepend to theregexp. Optional, so it's just vibes if you want them. β¨optionsβ aHashRefof conditions on which the matching will depend. Optional. Think of it as the vibe check the route has to pass before it matches. π
π METHODS π
πΈ match
Try to match the route with a given Dancer2::Core::Request object.
It returns the hash of matching data if it's a success β that's the captures and the values of the route against the path of the request β or undef if it's not. π (no match, no data, we move on.)
my $match = $route->match( $request );
π execute
Runs the coderef of the route. That's it, that's the whole thing. Go off. π₯
π AUTHOR π
Dancer Core Developers β kings and queens, honestly. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2026 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free as in freedom, bestie. ποΈ
ok so real talk: that's genuinely everything the page says. I didn't add a single thing, I just made it cute. π
mwah π this was perl v5.42.3 energy, dated 2026-09-20 β thanks for reading the whole thing, you ate that fr fr. π«Άβ¨
π¦ where this page comes from
- fedora 44: perl-Dancer2 2.2.1-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms