1URI::WithBase(3)      User Contributed Perl Documentation     URI::WithBase(3)
2
3
4

NAME

6       URI::WithBase - URIs which remember their base
7

SYNOPSIS

9        $u1 = URI::WithBase->new($str, $base);
10        $u2 = $u1->abs;
11
12        $base = $u1->base;
13        $u1->base( $new_base )
14

DESCRIPTION

16       This module provides the "URI::WithBase" class.  Objects of this class
17       are like "URI" objects, but can keep their base too.  The base
18       represents the context where this URI was found and can be used to
19       absolutize or relativize the URI.  All the methods described in URI are
20       supported for "URI::WithBase" objects.
21
22       The methods provided in addition to or modified from those of "URI"
23       are:
24
25       $uri = URI::WithBase->new($str, [$base])
26           The constructor takes an optional base URI as the second argument.
27           If provided, this argument initializes the base attribute.
28
29       $uri->base( [$new_base] )
30           Can be used to get or set the value of the base attribute.  The
31           return value, which is the old value, is a URI object or "undef".
32
33       $uri->abs( [$base_uri] )
34           The $base_uri argument is now made optional as the object carries
35           its base with it.  A new object is returned even if $uri is already
36           absolute (while plain URI objects simply return themselves in that
37           case).
38
39       $uri->rel( [$base_uri] )
40           The $base_uri argument is now made optional as the object carries
41           its base with it.  A new object is always returned.
42

SEE ALSO

44       URI
45
47       Copyright 1998-2002 Gisle Aas.
48
49
50
51perl v5.28.0                      2018-04-22                  URI::WithBase(3)
Impressum