Net::RD...:Address(3)
๐ NAME ๐
Net::RDAP::JCard::Address โ it's a module, bestie, and it represents a postal address inside a Net::RDAP::JCard object. That's it, that's the job. ๐
Oh and btw, this whole thing is a page from the User Contributed Perl Documentation section, so you know it's the real deal. โจ
๐ฆ SYNOPSIS ๐ฆ
okay so first you gotta get the jcard, like so:
#
# get an object by calling the jcard() method on a Net::RDAP::Object::Entity
#
my $jcard = $entity->jcard;
#
# get the first address. You can also uses $jcard->addresses() to get all
# ADR properties.
#
my $adr = $jcard->first_address;
if ($adr->structured) {
#
# This is a structured address so we can extract the individual components:
#
map { say "Street: ".$_ } @{$adr->street};
say "Locality: ".$adr->locality;
say "Region: ".$adr->region;
say "Postal Code: ".$adr->code;
say "Country: ".($adr->cc || $adr->country);
} else {
#
# This is an unstructured address, so just print it:
#
say "Address:".$adr->address;
}
see how there's two whole vibes in there? structured addresses let you pull out every little piece, and unstructured ones you just print as-is. both valid. both slay. ๐ซถ
๐ธ DESCRIPTION ๐ธ
so. postal addresses. the vCard representation (<https://www.rfc-editor.org/rfc/rfc6350.html#section-6.3.1>) and the jCard representation (<https://datatracker.ietf.org/doc/html/rfc7095#section-3.3.1.3>) are... a lot. like, genuinely a struggle. they are hard to deal with and they cause difficulties, and that's just the truth of it. ๐ญ
so Net::RDAP::JCard::Address swoops in with an ergonomic interface to "ADR" properties inside jCard objects. your wrists will thank you.
and to actually get one of these bad boys? use the first_address() or addresses() methods of Net::RDAP::JCard โ they hand you back an array of address objects. ๐
๐ METHODS ๐
Net::RDAP::JCard::Address inherits from Net::RDAP::JCard::Property, so it's already got all of that module's methods (iconic behaviour, honestly), plus everything below. ๐
โจ ADDRESS TYPE โจ
$structured = $adr->structured;
returns true if the address is "structured" โ and if you want the full lore on that, it's Section 3.3.1.3 of RFC 7095 (<https://datatracker.ietf.org/doc/html/rfc7095#section-3.3.1.3>). ๐
๐ FLAT ADDRESS ๐
say $adr->address;
hands you back a multi-line text string with the whole address in it. and listen โ for "unstructured" addresses this is the only format available, so it's literally the simplest way to display the address info. no cap. ๐
๐ฎ P.O. BOX NUMBER ๐ฎ
say $adr->pobox;
returns the Post Office box number, or "undef". (and yeah, "undef" is always an option, she's flexible like that.) ๐
๐ข EXTENDED ADDRESS ๐ข
say $adr->extended;
returns the "extended" address component โ you know, the apartment number, the suite number, that whole situation โ or "undef". ๐
๐ฃ๏ธ STREET ADDRESS ๐ฃ๏ธ
map { say $_ } @{$adr->street};
okay so some structured addresses have just one street address, but some have multiple street addresses, and those get represented as an arrayref. the way that works is lowkey important.
this method will always return an arrayref, bestie, and that arrayref may contain zero, one, or many values. plan accordingly. ๐
๐๏ธ LOCALITY ๐๏ธ
say $adr->locality;
returns the locality, or "undef". โญ
๐บ๏ธ REGION ๐บ๏ธ
say $adr->region;
returns the region, or "undef". ๐ธ
๐ฌ POSTAL CODE ๐ฌ
say $adr->code;
returns the postal code, or "undef". ๐
๐ COUNTRY CODE ๐
say $adr->cc;
returns the ISO-3166-alpha2 country code โ full details in Section 3.1 of RFC 8605 (<https://www.rfc-editor.org/rfc/rfc8605.html#section-3.1>) โ or "undef". ๐ฅ
๐ณ๏ธ COUNTRY NAME ๐ณ๏ธ
say $adr->country;
returns the country name, or "undef". ๐ฆ
๐ COPYRIGHT ๐
Copyright 2018-2023 CentralNic Ltd, 2024-2026 Gavin Brown. For licensing information, please see the "LICENSE" file in the Net::RDAP distribution. ๐
k bye bestie, go forth and parse some addresses ๐
perl v5.42.2 ๐ฉท 2026-06-17 โ that's the version and the date this lil page was born, and honestly? ate. ๐โจ
๐ฆ where this page comes from
- fedora 44: perl-Net-RDAP 0.43-1.fc44 ยท BSD-2-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms