HTML::...:Utils(3pm)
β¨ HTML::Mason::Utils(3pm) β¨
okay bestie, welcome to the group chat π this is HTML::Mason::Utils, straight out of the User Contributed Perl Documentation corner of the perl universe. grab a strawberry π and let's get into it.
πΈ NAME πΈ
HTML::Mason::Utils β these are Publicly available functions useful outside of Mason. yes, really, you're allowed to use them, they're not gatekept π
π¦ DESCRIPTION π¦
so like, the functions in this module? they're the ones you want when you need to interface code you have written with Mason. that's the whole vibe. you wrote some code, it lives outside Mason, and now it needs to talk to Mason. these are the little connectors that make that happen π«Ά
π FUNCTIONS π
π data_cache_namespace ($comp_id)
okay so you hand this one a component id, and it gives you back that component's default Cache::Cache namespace. iconic behavior honestly β¨
and why do you care? because it means you can access the cached data outside of Mason. no cap, that's the whole point β your code out here in the wild can go touch the same cache π
now, the component id situation depends on your roots, so listen up:
- with a single component root, the component id is just the component path. simple. clean. slay.
- with multiple component roots, the component id is
"key"/"path", wherekeyis the key corresponding to the root that the component falls under. so you need both pieces, don't skip the key bestie π
π§ cgi_request_args ($cgi, $method)
this one expects two things from you: a CGI.pm object, and the request method (GET, POST, etc). give it those two things and it's going to give you back... a hash π (in list context) or a hashref (in scalar context). either way you eat π½οΈ
what's in that hash(ref)? all the arguments passed via the CGI request. and the structure is:
- the keys are argument names
- the values are either scalars or array references
that's it, that's the tea β
π a lil sign-off π
this whole thing is perl v5.38.2, dated 2024-03-05, and it ships as HTML::Mason::Utils(3pm) under User Contributed Perl Documentation. periodt. go forth and interface your code with Mason, main character π πβ
π¦ where this page comes from
- debian trixie: libhtml-mason-perl 1:1.60-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-mason-perl 1:1.60-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-mason-perl 1:1.60-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