GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
URI::Namespace(3) User Contributed Perl Documentation URI::Namespace(3)

URI::Namespace - A namespace URI/IRI 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/IRI 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 | IRI )"
This is the constructor. You may pass a string with a URI or a URI object.
"uri ( [ $local_part ] )"
Returns a URI object with the namespace IRI. Optionally, the method can take a local part as argument, in which case, it will return the namespace URI with the local part appended.
"iri ( [ $local_part ] )"
Returns a IRI object with the namespace IRI. Optionally, the method can take a local part as argument, in which case, it will return the namespace IRI with the local part appended.
"local_part ( $uri )"
Returns the local part string if the given argument URI (which may be a string, URI or IRI object) matches the namespace URI, or "undef" if not.

The following methods from URI can be used on an URI::Namespace object: "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.

2024-01-11 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.