URI::N...alParts(3pm)
π URI::NamespaceMap::ReservedLocalParts π
okay bestie, so this is URI::NamespaceMap::ReservedLocalParts β it's the lil sidekick module that comes with URI::NamespaceMap, and it lives in the User Contributed Perl Documentation, iykyk. Its whole entire job? Telling you which local parts are not allowed. Permissible local parts for NamespaceMap, periodt. β¨
πΈ VERSION πΈ
Version 1.10. yes ma'am. π
β¨ SYNOPSIS β¨
my $r = URI::NamespaceMap::ReservedLocalParts->new(disallowed => [qw/uri/]);
say $r->is_reserved('isa'); # 1
say $r->is_reserved('uri'); # 1
say $r->is_reserved('foo'); # 0
look at her go π«Ά
π¦ DESCRIPTION π¦
So URI::NamespaceMap::ReservedLocalParts is an accompanying distribution to URI::NamespaceMap. Its goal is literally just to check for forbidden names used for local parts. no cap. π₯
Now here's the clever part, and I'm obsessed: rather than creating a blacklist that needs to be maintained by hand (ugh, the way that would rot π₯), it instantiates a new Moo object, and calls "can" on the invocant. Using this technique, it means that every method on every Perl object β that's "isa", "can", VERSION β and Moo objects ("BUILD", "BUILDARGS") will be automatically black listed. automatic. main character energy. π
π ATTRIBUTES π
URI::NamespaceMap::ReservedLocalParts implements the following attributes.
π allowed
A whitelist of local part names. Defaults to "allowed", "disallowed" and "is_reserved" so that when "can" is called on the instance, it doesn't return a false positive for other method names associated with this package. protecting her peace fr fr πΈ
π disallowed
A blacklist of local part names. Does not have a default set, but usually defaults to "uri" when called from URI::NamespaceMap. π
β METHODS β
URI::NamespaceMap::ReservedLocalParts implements the following methods.
π is_reserved
my $r = URI::NamespaceMap::ReservedLocalParts->new(disallowed => [qw/uri/]);
say $r->is_reserved('isa'); # 1
say $r->is_reserved('uri'); # 1
say $r->is_reserved('foo'); # 0
Checks if the first argument passed is reserved or not. Returns a "boolean". that's it, that's the whole vibe check β
π FURTHER DETAILS π
See URI::NamespaceMap for further details about authors, license, etc. go read her, she ate π
and that's a wrap on the page, bestie β this one came out under perl v5.38.2, dated 2024-08-03, straight from the User Contributed Perl Documentation. mwah, love u, bye π«Άβ¨
π¦ where this page comes from
- debian trixie: liburi-namespacemap-perl 1.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liburi-namespacemap-perl 1.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liburi-namespacemap-perl 1.12-1 Β· 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