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 the regexp. Optional, so it's just vibes if you want them. ✨
  • options β€” a HashRef of 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. πŸ‘‘


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