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's false), or parsed only when an IRI component is actually accessed (that's true). And if no components are ever needed β€” like if an IRI is constructed with a value and value is 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 $base IRI, 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 a HASH of 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 (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