IRI(3)
π IRI(3) β Internationalized Resource Identifiers π
okay so this is the <pink>IRI(3)</pink> page, from the User Contributed Perl Documentation section of the manual, and bestie it is so good. grab a snack, we're learning about IRIs π
β¨ NAME β¨
IRI β Internationalized Resource Identifiers. that's it, that's the name, and honestly? iconic. π
πΈ VERSION πΈ
This document describes IRI version 0.15. slay. π
π¦ SYNOPSIS π¦
like, here's the vibe in code form:
use IRI;
my $i = IRI->new(value => 'https://example.org:80/index#frag');
say $i->scheme; # 'https'
say $i->path; # '/index'
my $base = IRI->new(value => "http://www.hestebedg\x{e5}rd.dk/");
my $i = IRI->new(value => '#frag', base => $base);
say $i->abs; # 'http://www.hestebedgΓ₯rd.dk/#frag'
# Defer parsing of the IRI until necessary
my $i = IRI->new(value => "http://www.hestebedg\x{e5}rd.dk/", lazy => 1);
say $i->path; # path is parsed here
see how the last one is out here living its main character life and not parsing anything until you literally ask for it? that's the lazy vibe, we'll get there. π
π DESCRIPTION π
The IRI module gives you an object representation for Internationalized Resource Identifiers (IRIs), exactly as defined by RFC 3987 <http://www.ietf.org/rfc/rfc3987.txt>, and it supports their parsing, serializing, and base resolution. so like, it does the whole glow-up: read it, write it, resolve it against a base. no cap. β¨
π ATTRIBUTES π
lazyβ a boolean value, and here's the tea: it says whether the IRI should be parsed (and validated) during object construction (that'sfalse), or parsed only when an IRI component is actually accessed (that'strue). And if no components are ever needed β like if an IRI is constructed with avalueandvalueis the only accessor ever called β then no parsing will take place at all. zero work, zero drama, we love a low-effort queen π«Ά
π METHODS π
as_stringβ returns the absolute IRI string resolved against the base IRI, if present; otherwise it returns the relative IRI string. it's giving "I'll be absolute if I have a base, otherwise I'm just me". πββοΈabsβ returns the absolute IRI string (resolved against the base IRI if present). yes bestie, it is that girl.scheme,host,port,user,path,fragment,queryβ each one of these returns its own respective component of the parsed IRI. one accessor, one component, no mixing, we respect boundaries πrel ( $base )β returns a new relative IRI object which, when resolved against the$baseIRI, is equal to this IRI. like, it's the same IRI but it's learned to be humble about it. π§is_absoluteβ returns true if the IRI is absolute, false otherwise. quick vibe check, in and out. βquery_formβ returns aHASHof key-value mappings for the unencoded, parsed query form data. yes, unencoded β it already did the decoding for you, you're welcome. π₯set_query_param ( $key => $value )β sets the respective query form value and returns a new IRI object. not a mutation, a rebirth. new object, new era. β¨
π¦ SEE ALSO π¦
<http://www.ietf.org/rfc/rfc3987.txt> β go read the RFC bestie, it's the source material, it's the blueprint, it's the blueprint of the blueprint. iykyk π
π AUTHOR π
Gregory Todd Williams "<gwilliams@cpan.org>" β thank you king, we are obsessed π
π COPYRIGHT π
Copyright (c) 2014--2024 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
fr fr, that's the whole page. every flag, every method, every component. no crumbs left behind. π
kisses bestie, this page was served by perl v5.32.1 on 2026-10-15, and you're reading IRI(3) β go build something cute with it π
β¨π
π¦ where this page comes from
- epel 9: perl-IRI 0.15-1.el9 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms