NAME
URI::PathAbstract - A URI-like object with Path::Abstract capabilities
SYNOPSIS
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
DESCRIPTION
URI::PathAbstract is a combination of the URI and Path::Abstract classes. It is essentially a URI class that delegate 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
METHODS
URI::PathAbstract->new( <uri> )
Create a new URI::PathAbstract object based on <uri>
<uri> should be of the URI class or some sort of URI-like string
URI::PathAbstract->new( <uri>, path => <path> )
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"
URI::PathAbstract->new( <uri>, child => <child> )
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"
$uri->uri
Returns a URI object that is a copy (not a reference) of the URI object inside $uri
$uri->path
Returns a Path::Abstract object that is a copy (not a reference) of the Path::Abstract object inside $uri
$uri->path( <path> )
Sets the path of $uri, completely overwriting what was there before
The rest of $uri (host, port, scheme, query, ...) does not change
$uri->clone
Returns a URI::PathAbstract that is an exact clone of $uri
* URI *
See URI for more information
$uri->scheme
$uri->fragment
$uri->as_string
$uri->canonical
$uri->eq
$uri->authority
$uri->query
$uri->query_form
$uri->query_keywords
$uri->userinfo
$uri->host
$uri->port
$uri->host_port
$uri->default_port
$uri->abs
Returns a URI::PathAbstract object
$uri->rel
Returns a URI::PathAbstract object
$uri->opaque
$uri->path_query
$uri->path_segments
* Path::Abstract *
See Path::Abstract for more information
$uri->child
$uri->parent
$uri->list
$uri->first
$uri->last
$uri->is_empty
$uri->is_nil
$uri->is_root
$uri->is_tree
$uri->is_branch
SEE ALSO
AUTHOR
Robert Krimen, <rkrimen at cpan.org>
SOURCE
You can contribute or fork this project via GitHub:
http://github.com/robertkrimen/path-abstract/tree/master
git clone git://github.com/robertkrimen/path-abstract.git Path-Abstract