The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

URI - Uniform Resource Identifiers (absolute and relative)

SYNOPSIS

 $u1 = URI->new("http://www.perl.com");
 $u2 = URI->new("foo", "http");
 $u3 = $u2->abs($u1);
 $u4 = $u3->clone;
 $u5 = URI->new("HTTP://WWW.perl.com:80")->canonical;

 $str = $u->as_string;
 $str = "$u";

 $scheme = $u->scheme;
 $opaque = $u->opaque;
 $path   = $u->path;
 $frag   = $u->fragment;

 $u->scheme("ftp");
 $u->host("ftp.perl.com");
 $u->path("cpan/");

DESCRIPTION

This module implements the URI class. Objects of this class represent Uniform Resource Identifiers (URI) references as specified in RFC 2396.

A Uniform Resource Identifier is a compact string of characters for identifying an abstract or physical resource. A Uniform Resource Identifier can be further classified either a Uniform Resource Locator (URL) or a Uniform Resource Name (URN). The distinction between URL and URN is not reflected in the abstractions provided by the URI class.

The following methods are provided:

$uri = URI->new( $str, [$scheme] )
$uri->clone
$uri->scheme( [$new_scheme] )

$uri->_scheme

$uri->opaque( [$new_opaque] )
$uri->path( [$new_path] )
$uri->fragment( [$new_frag] )
$uri->as_string
$uri->eq( $other_uri )
$uri->abs( $base_uri )
$uri->rel( $base_uri )

Generic methods:

$uri->query( [$new_query] )
$uri->query_form( [$key => $value,...] )
$uri->query_keywords( [$keywords,...] )
$uri->authority( [$new_authority] )
$uri->path_query( [$new_path_query] )
$uri->path_segments( [$segment,...] )

Server methods:

$uri->userinfo( [$new_userinfo] )
$uri->host( [$new_host] )
$uri->port( [ $new_port] )

$uri->_port()

$uri->default_port;

SEE ALSO

URI::WithBase, URI::Escape, URI::Heuristic

RFC 2396

COPYRIGHT

Copyright 1995-1998 Gisle Aas.

Copyright 1995 Martijn Koster.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS / ACKNOWLEDGMENTS

This module is based on the URI::URL module, which in turn was (distantly) based on the wwwurl.pl code in the libwww-perl for perl4 developed by Roy Fielding, as part of the Arcadia project at the University of California, Irvine, with contributions from Brooks Cutter.

URI::URL was developed by Gisle Aas, Tim Bunce, Roy Fielding and Martijn Koster with input from other people on the libwww-perl mailing list.