URI::Namespace - A namespace URI class with autoload methods
use URI::Namespace; my $foaf = URI::Namespace->new( 'http://xmlns.com/foaf/0.1/' ); print $foaf->as_string; print $foaf->name;
This module provides an object with a URI attribute, typically used prefix-namespace pairs, typically used in XML, RDF serializations, etc. The local part can be used as a method, these are autoloaded.
new ( $string | URI )
This is the constructor. You may pass a string with a URI or a URI object.
uri
Returns a URI object with the namespace URI.
The following methods from URI can be used on an URI::Namespace object: as_string, as_iri, canonical, eq, abs, rel.
as_string
as_iri
canonical
eq
abs
rel
One important usage for this module is to enable you to create URIs for full URIs, e.g.:
print $foaf->Person->as_string;
will return
http://xmlns.com/foaf/0.1/Person
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.