URI::NamespaceMap::ReservedLocalParts - Permissible local parts for NamespaceMap
Version 1.04
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
URI::NamespaceMap::ReservedLocalParts is an accompanying distribution to URI::NamespaceMap. It's goal is to check for forbidden names used for local parts.
Rather than creating a blacklist that needs to be maintained, it instantiates a new Moo object, and calls can on the invocant. Using this technique, it means that every method on every Perl object (isa, can, VERSION), and Moo objects (BUILD, BUILDARGS) will be automatically black listed.
can
isa, can, VERSION
BUILD, BUILDARGS
URI::NamespaceMap::ReservedLocalParts implements the following attributes.
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.
allowed
disallowed
is_reserved
A blacklist of local part names. Does not have a default set, but usually defaults to uri when called from URI::NamespaceMap.
uri
URI::NamespaceMap::ReservedLocalParts implements the following methods.
Checks if the first argument passed is reserved or not. Returns a boolean.
boolean
See URI::NamespaceMap for further details about authors, license, etc.
To install URI::NamespaceMap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URI::NamespaceMap
CPAN shell
perl -MCPAN -e shell install URI::NamespaceMap
For more information on module installation, please visit the detailed CPAN module installation guide.