NAME
Curse::URL - Uniform Resource Locators
SYNOPSIS
use Curse::URL;
# Parse
my $url = Curse::URL->new(
'http://sri:foobar@kraih.com:3000/foo/bar?foo=bar#23'
);
print $url->scheme;
print $url->userinfo;
print $url->user;
print $url->password;
print $url->host;
print $url->port;
print $url->path;
print $url->query;
print $url->fragment;
# Build
my $url = Curse::URL->new;
$url->scheme('http');
$url->userinfo('sri:foobar');
$url->host('kraih.com');
$url->port(3000);
$url->path->parts(qw/foo bar/);
$url->query->params(foo => 'bar');
$url->fragment(23);
print "$url";
DESCRIPTION
Curse::URL implements a subset of RFC 3986 for Uniform Resource Locators.
ATTRIBUTES
authority
my $authority = $url->autority;
$url = $url->authority('root:pass%3Bw0rd@localhost:8080');
base
my $base = $url->base;
$url = $url->base(Curse::URL->new);
fragment
my $fragment = $url->fragment;
$url = $url->fragment('foo');
host
my $host = $url->host;
$url = $url->host('127.0.0.1');
password
my $password = $url->password;
$url = $url->password('pass;w0rd');
path
my $path = $url->path;
$url = $url->path(Curse::Path->new);
port
my $port = $url->port;
$url = $url->port(8080);
query
my $query = $url->query;
$url = $url->query(Curse::Parameters->new);
scheme
my $scheme = $url->scheme;
$url = $url->scheme('http');
user
my $user = $url->user;
$url = $url->userinfo('root');
userinfo
my $userinfo = $url->userinfo;
$url = $url->userinfo('root:pass%3Bw0rd');
METHODS
Curse::URL inherits all methods from Nevermore and implements the following new ones.
new
my $url = Curse::URL->new;
my $url = Curse::URL->new('http://127.0.0.1:3000/foo?f=b&baz=2#foo');
as_absolute
my $abs = $url->as_absolute;
my $abs = $url->as_absolute(Curse::URL->new('http://kraih.com/foo'));
as_relative
my $rel = $url->as_relative;
my $rel = $url->as_relative(Curse::URL->new('http://kraih.com/foo'));
as_string
my $string = $url->as_string;
is_absolute
my $is_absolute = $url->is_absolute;
parse
$url = $url->parse('http://127.0.0.1:3000/foo/bar?fo=o&baz=23#foo');