ihrd/uri/lib/URI
uri src
=head NAME
URI — Uniform Resource Identifiers (absolute and relative)
=head SYNOPSYS
use URI;
my $u = URI.new('http://her.com/foo/bar?tag=woow#bla');
my $scheme = $u.scheme;
my $authority = $u.authority;
my $host = $u.host;
my $port = $u.port;
my $path = $u.path;
my $query = $u.query;
my $frag = $u.frag; # or $u.fragment;
my $tag = $u.query_form<tag>; # should be woow
my $is_absolute = $u.absolute;
my $is_relative = $u.relative;
# something p5 URI without grammar could not easily do !
my $host_in_grammar =
$u.grammar.parse_result<URI_reference><URI><hier_part><authority><host>;
if ($host_in_grammar<reg_name>) {
say 'Host looks like registered domain name - approved!';
}
else {
say 'Sorry we do not take ip address hosts at this time.';
say 'Please use registered domain name!';
}
# require whole string matches URI and throw exception otherwise ..
my $u_v = URI.new('http://?#?#', :is_validating<1>);# throw exception