110 lines
2.6 KiB
HTML
110 lines
2.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of URI::WithBase</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>URI::WithBase</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2020-02-08<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
URI::WithBase - URIs which remember their base
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
$u1 = URI::WithBase->new($str, $base);
|
|
$u2 = $u1->abs;
|
|
|
|
$base = $u1->base;
|
|
$u1->base( $new_base )
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This module provides the <TT>"URI::WithBase"</TT> class. Objects of this class
|
|
are like <TT>"URI"</TT> objects, but can keep their base too. The base
|
|
represents the context where this <FONT SIZE="-1">URI</FONT> was found and can be used to
|
|
absolutize or relativize the <FONT SIZE="-1">URI.</FONT> All the methods described in <FONT SIZE="-1">URI</FONT>
|
|
are supported for <TT>"URI::WithBase"</TT> objects.
|
|
<P>
|
|
|
|
The methods provided in addition to or modified from those of <TT>"URI"</TT> are:
|
|
<DL COMPACT>
|
|
<DT id="1">$uri = URI::WithBase->new($str, [$base])<DD>
|
|
|
|
|
|
|
|
|
|
The constructor takes an optional base <FONT SIZE="-1">URI</FONT> as the second argument.
|
|
If provided, this argument initializes the base attribute.
|
|
<DT id="2">$uri->base( [$new_base] )<DD>
|
|
|
|
|
|
|
|
|
|
Can be used to get or set the value of the base attribute.
|
|
The return value, which is the old value, is a <FONT SIZE="-1">URI</FONT> object or <TT>"undef"</TT>.
|
|
<DT id="3">$uri->abs( [$base_uri] )<DD>
|
|
|
|
|
|
|
|
|
|
The <TT>$base_uri</TT> argument is now made optional as the object carries its
|
|
base with it. A new object is returned even if <TT>$uri</TT> is already
|
|
absolute (while plain <FONT SIZE="-1">URI</FONT> objects simply return themselves in
|
|
that case).
|
|
<DT id="4">$uri->rel( [$base_uri] )<DD>
|
|
|
|
|
|
|
|
|
|
The <TT>$base_uri</TT> argument is now made optional as the object carries its
|
|
base with it. A new object is always returned.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">URI</FONT>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 1998-2002 Gisle Aas.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="5"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="6"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="7"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="8"><A HREF="#lbAE">SEE ALSO</A><DD>
|
|
<DT id="9"><A HREF="#lbAF">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:59 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|