Web::M...Router(3pm)

πŸ“¦
version 0.290 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Web::M...Router(3pm) πŸ’–

okay bestie, so this is Web::MREST::InitRouter β€” it's the module with all the routines for initializing our Path::Router instance. she's the one who gets the router ready to go, no cap. 🌸


✨ NAME ✨

Web::MREST::InitRouter β€” Routines for initializing our Path::Router instance πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

so here's the tea: Web::MREST uses Path::Router to match URIs to resources. and the way she does it?? all resources get packed into a single object. one object. everything. iconic behavior fr fr πŸ‘‘

that singleton is exported as $router from this module, and you can initialize it by calling init_router β€” which is also exported, bestie β€” with no arguments. like, none. zero. she said "I don't need your input, I got this" πŸ’…

use Web::MREST::InitRouter qw( $router );

...

Web::MREST::InitRouter::init_router() unless defined $router and $router->can( 'match' );

^^ see that? only init if $router isn't defined yet or she can't match. no double-initializing in this house 🫢


πŸ‘‘ PACKAGE VARIABLES πŸ‘‘

(nothing listed here in the original, bestie β€” it's just vibing as an empty section πŸ’€)


🌈 EXPORTS 🌈

this module provides the following exports:

  • $router β€” the Path::Router singleton, your one and only ✨
  • $resources β€” the expanded resource definitions, all spread out and ready πŸ“‹

πŸ”₯ FUNCTIONS πŸ”₯

(also empty in the original β€” she's mysterious like that 🧚)


lowkey a short page, but every bit of it slays. use $router, call init_router(), and go match some URIs. periodt. πŸ’–

and that's the whole page, bestie!! ✨ this was Web::M...Router(3pm) from the User Contributed Perl Documentation, running on perl v5.40.1, dated 2025-06-21. mwah, go forth and route πŸŽ€πŸ’œπŸ¦‹

πŸ“¦ where this page comes from