URI::Split3pm
Parse and compose uri strings
Usage
use URI::Split qw(uri_split uri_join);($scheme, $auth, $path, $query, $frag) = uri_split($uri);$uri = uri_join($scheme, $auth, $path, $query, $frag);
Overview
Provides functions to parse and compose URI strings. The following functions are provided:
- ($scheme, $auth, $path, $query, $frag) = uri_split($uri)
-
Breaks up a URI string into its component parts. An
"undef"value is returned for those parts that are not present. The$pathpart is always present (but can be the empty string) and is thus never returned as"undef".No sensible value is returned if this function is called in a scalar context.
- $uri = uri_join($scheme, $auth, $path, $query, $frag)
-
Puts together a URI string from its parts. Missing parts are signaled by passing
"undef"for the corresponding argument.Minimal escaping is applied to parts that contain reserved chars that would confuse a parser. For instance, any occurrence of '?' or '#' in
$pathis always escaped, as it would otherwise be parsed back as a query or fragment.
Releases
12 releases since Debian 3.1 (Sarge); the text changed 11 times.