1IRI(3) User Contributed Perl Documentation IRI(3)
2
3
4
6 IRI - Internationalized Resource Identifiers
7
9 This document describes IRI version 0.009
10
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
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
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
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 "query_form"
59 Returns a HASH of key-value mappings for the unencoded, parsed
60 query form data.
61
62 "set_query_param ( $key => $value )"
63 sets the respective query form value and returns a new IRI object.
64
66 <http://www.ietf.org/rfc/rfc3987.txt>
67
69 Gregory Todd Williams "<gwilliams@cpan.org>"
70
72 Copyright (c) 2014--2018 Gregory Todd Williams. This program is free
73 software; you can redistribute it and/or modify it under the same terms
74 as Perl itself.
75
76
77
78perl v5.28.0 2018-10-30 IRI(3)