URI::PathAbstract - A URI-like object with Path::Abstract capabilities
Version 0.01
my $uri = URI::PathAbstract->new("http://example.com?a=b") $uri->down("apple") # http://example.com/apple?a=b $uri->query("c=d&e=f") # http://example.com/apple?c=d&e=f $uri->path("grape/blueberry/pineapple") # http://example.com/grape/blueberry/pineapple?c=d&e=f $uri = $uri->parent # http://example.com/grape/blueberry?c=d&e=f $uri = $uri->child("xyzzy") # http://example.com/grape/blueberry/xyzzy?c=d&e=f
URI::PathAbstract is a combination of the URI::WithBase and Path::Abstract classes. It is essentially a URI class that delegates path-handling methods to Path::Abstract
Unfortunately, this is not true:
URI::PathAbstract->new( http://example.com )->isa( URI )
URI::PathAbstract supports the URI generic and common methods
Create a new URI::PathAbstract object based on <uri>
<uri> should be of the URI class or some sort of URI-like string
Create a new URI::PathAbstract object based on <uri> but overriding the path with <path>
URI::PathAbstract->new("http://example.com/cherry?a=b", path => "grape/lemon") # http://example.com/grape/lemon?a=b"
Create a new URI::PathAbstract object based on <uri> but modifying the path by <child>
URI::PathAbstract->new("http://example.com/cherry?a=b", child => "grape/lemon") # http://example.com/cherry/grape/lemon?a=b"
Create a new URI::PathAbstract object based on the following:
uri The URI you want to represent base A base URI for use with ->abs and ->rel path A path that will override the path of the given uri (although the scheme, host, ... will remain the same) child A path that will be appended to the path of the given uri
Returns a URI object that is a copy (not a reference) of the URI object inside $uri
Returns a Path::Abstract object that is a copy (not a reference) of the Path::Abstract object inside $uri
Sets the path of $uri, completely overwriting what was there before
The rest of $uri (host, port, scheme, query, ...) does not change
Returns a URI::PathAbstract that is an exact clone of $uri
Returns a URI::PathAbstract object that is a copy (not a reference) of the base for $uri
Returns undef if $uri does not have a base uri
Sets the base of $uri to <base>
Returns a URI::PathAbstract object that is the absolute URI formed by combining $uri and <base>
If <base> is not given, then $uri->base is used as the base
If <base> is not given and $uri->base does not exist, then a clone of $uri is returned
See URI and URI::WithBase for more abs information
abs
Returns a URI::PathAbstract object that is the relative URI formed by comparing $uri and <base>
See URI and URI::WithBase for more rel information
rel
See URI for more information
See Path::Abstract for more information
URI
URI::WithBase
Path::Abstract
Path::Resource
URI::SmartURI
Robert Krimen, <rkrimen at cpan.org>
<rkrimen at cpan.org>
You can contribute or fork this project via GitHub:
http://github.com/robertkrimen/uri-pathabstract/tree/master
git clone git://github.com/robertkrimen/uri-pathabstract.git URI-PathAbstract
Please report any bugs or feature requests to bug-uri-pathabstract at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=URI-PathAbstract. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-uri-pathabstract at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc URI::PathAbstract
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=URI-PathAbstract
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/URI-PathAbstract
CPAN Ratings
http://cpanratings.perl.org/d/URI-PathAbstract
Search CPAN
http://search.cpan.org/dist/URI-PathAbstract
Copyright 2008 Robert Krimen, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install URI::PathAbstract, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URI::PathAbstract
CPAN shell
perl -MCPAN -e shell install URI::PathAbstract
For more information on module installation, please visit the detailed CPAN module installation guide.