URI::Nested(3pm)
π Name π
okay so bestie, welcome to URI::Nested(3pm) β User Contributed Perl Documentation, and this is the manual for URI::Nested, aka Nested URIs. Itβs giving βa URI inside a URIβ main character energy, and weβre gonna get into it. π
π οΈ Synopsis π οΈ
package URI::jdbc;
use parent 'URI::Nested';
sub prefix { 'jdbc' }
sub nested_class { undef }
sub subprotocol { shift->nested_uri->scheme(@_) }
package main;
my $jdbc_uri = URI->new('jdbc:oracle:scott/tiger@//myhost:1521/myservicename');
my $nested_uri = $jdbc_uri->nested_uri;
πΈ Description πΈ
This class provides support for nested URIs, where the scheme is a prefix and the remainder of the URI is another URI. Examples include JDBC URIs (http://docs.oracle.com/cd/B14117_01/java.101/b10979/urls.htm#BEIJFHHB) and database URIs (https://github.com/theory/uri-db). Obsessed, honestly. β¨
π Interface π
The following differences exist compared to the URI class interface:
β¨ Class Method β¨
prefixβ Returns the prefix to be used, which corresponds to the URIβs scheme. Defaults to the last part of the class name.nested_classβ Returns the URI subclass to use for the nested URI. If defined, the nested URI will always be coerced into this class if it is not naturally an instance of this class or one of its subclasses.
π Constructors π
newβ yep, the constructor. Signatures are:
my $uri = URI::Nested->new($string);
my $uri = URI::Nested->new($string, $base);
Always returns a URI::Nested object. $base may be another URI object or string. Unlike in URIβs new(), schemes will always be applied to the URI and the nested URI if they donβt already have schemes. And if nested_class is defined, the nested URI will be coerced into that class. π«Ά
π Accessors π
schemeβ gets/sets the scheme part of the URI:
my $scheme = $uri->scheme;
$uri->scheme( $new_scheme );
When setting the scheme, it must always be the same as the value returned by prefix or an exception will be thrown β although the letter casing may vary. The returned value is always lowercase.
nested_uriβ returns the nested URI:
my $nested_uri = $uri->nested_uri;
π§ Instance Methods π§
absβ returns theURI::Nestedobject itself:
my $abs = $uri->abs( $base_uri );
Unlike URIβs abs(), $URI::ABS_ALLOW_RELATIVE_SCHEME is ignored. π
relβ returns theURI::Nestedobject itself:
my $rel = $uri->rel( $base_uri );
π«Ά Support π«Ά
This module is stored in an open GitHub repository (http://github.com/theory/uri-db/). Feel free to fork and contribute!
Please file bug reports via GitHub Issues (http://github.com/theory/uri-db/issues/) or by sending mail to bug-URI-db@rt.cpan.org.
π Author π
David E. Wheeler β david@justatheory.com.
π Copyright and License π
Copyright (c) 2013 David E. Wheeler. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay bestie, thatβs the whole manual π β source/version perl v5.42.0, date 2015-04-24, manual URI::Nested(3pm). slay, periodt β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-URI-Nested 0.10-bp160.1.4 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms