URI::duri - the duri URI scheme
my $uri = URI->new('duri:2012:http://tobyinkster.co.uk/'); say $uri->embedded_uri;
The dated URI scheme is defined in an Internet Draft http://tools.ietf.org/html/draft-masinter-dated-uri-10. Dated URIs include a date and an embedded URI. They identify the same resource that was identified by the embedded URI at the given date.
This module brings support for the duri URI scheme to the URI framework.
The constructor can be called in two forms:
new($string)
new(\%hash)
When called with a string argument, must be a URI string conforming to the dated URI Internet Draft.
If called with a hashref argument, the hash must have a key embedded_uri which is a string or URI object. It may have a key datetime_string which is a string representing a datetime in the format required by the dated URI specification; alternatively it may have a key datetime which is a DateTime or (better) DateTime::Incomplete object; if neither are present, then the current time is used instead.
embedded_uri
datetime_string
datetime
The following accessors are provided:
datetime($object)
Get/set the URI's datetime as a DateTime::Incomplete object.
datetime_string($string)
Get/set the URI's datetime as a literal string.
embedded_uri($uri)
Get/set the embedded URI as a URI object. (The setter may also be called with a plain string.)
The following methods are inherited from URI and make sense to use:
scheme
scheme($string)
Get/set the URI scheme.
as_string
Get the URI as a string.
as_iri
Get the URI as a Unicode string.
canonical
Get the URI as a canonical string.
secure
Returns false, though the method doesn't make much sense. One URI is no more secure than another; it is protocols that can be secure or insecure.
eq($uri)
Tests if this URI is equal to another.
The following methods are also inherited from URI, but don't make much sense to use: opaque, path, fragment. It generally makes more sense to inspect the embedded URI:
opaque
path
fragment
say $duri->embedded_uri->fragment;
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=URI-duri.
URI, URI::tdb.
http://tools.ietf.org/html/draft-masinter-dated-uri-10.
http://www.perlrdf.org/.
DateTime::Incomplete.
Toby Inkster <tdb:2012:http://metacpan.org/author/TOBYINK>.
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install URI::duri, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URI::duri
CPAN shell
perl -MCPAN -e shell install URI::duri
For more information on module installation, please visit the detailed CPAN module installation guide.