1IRI(3)                User Contributed Perl Documentation               IRI(3)
2
3
4

NAME

6       IRI - Internationalized Resource Identifiers
7

VERSION

9       This document describes IRI version 0.011
10

SYNOPSIS

12         use IRI;
13
14         my $i = IRI->new(value => 'https://example.org:80/index#frag');
15         say $i->scheme; # 'https'
16         say $i->path; # '/index'
17
18         my $base = IRI->new(value => "http://www.hestebedg\x{e5}rd.dk/");
19         my $i = IRI->new(value => '#frag', base => $base);
20         say $i->abs; # 'http://www.hestebedgård.dk/#frag'
21
22         # Defer parsing of the IRI until necessary
23         my $i = IRI->new(value => "http://www.hestebedg\x{e5}rd.dk/", lazy => 1);
24         say $i->path; # path is parsed here
25

DESCRIPTION

27       The IRI module provides an object representation for Internationalized
28       Resource Identifiers (IRIs) as defined by RFC 3987
29       <http://www.ietf.org/rfc/rfc3987.txt> and supports their parsing,
30       serializing, and base resolution.
31

ATTRIBUTES

33       "lazy"
34           A boolean value indicating whether the IRI should be parsed (and
35           validated) during object construction (false), or parsed only when
36           an IRI component is accessed (true). If no components are ever
37           needed (e.g. an IRI is constructed with a "value" and "value" is
38           the only accessor ever called), no parsing will take place.
39

METHODS

41       "as_string"
42           Returns the absolute IRI string resolved against the base IRI, if
43           present; the relative IRI string otherwise.
44
45       "abs"
46           Returns the absolute IRI string (resolved against the base IRI if
47           present).
48
49       "scheme"
50       "host"
51       "port"
52       "user"
53       "path"
54       "fragment"
55       "query"
56           Returns the respective component of the parsed IRI.
57
58       "rel ( $base )"
59           Returns a new relative IRI object which, when resolved against the
60           $base IRI, is equal to this IRI.
61
62       "query_form"
63           Returns a HASH of key-value mappings for the unencoded, parsed
64           query form data.
65
66       "set_query_param ( $key => $value )"
67           sets the respective query form value and returns a new IRI object.
68

SEE ALSO

70       <http://www.ietf.org/rfc/rfc3987.txt>
71

AUTHOR

73       Gregory Todd Williams  "<gwilliams@cpan.org>"
74
76       Copyright (c) 2014--2018 Gregory Todd Williams. This program is free
77       software; you can redistribute it and/or modify it under the same terms
78       as Perl itself.
79
80
81
82perl v5.34.0                      2021-07-22                            IRI(3)
Impressum