GeoIP2...ntinent(3pm)
β¨ NAME β¨
Okay bestie, welcome to GeoIP2::Record::Continent π β it's the little record class that holds all the continent-level tea for whatever IP address you threw at it. It lives in the User Contributed Perl Documentation corner of your manual pages (yes, that's a 3pm situation), and it's here to hand you continent data like it's nothing.
πΈ VERSION πΈ
This is version 2.006002 β that's the one you're reading rn, no cap.
π¦ SYNOPSIS π¦
Here's the whole vibe, literally copy-paste energy:
use 5.008;
use GeoIP2::WebService::Client;
my $client = GeoIP2::WebService::Client->new(
account_id => 42,
license_key => 'abcdef123456',
);
my $insights = $client->insights( ip => '24.24.24.24' );
my $continent_rec = $insights->continent();
print $continent_rec->name(), "\n";
See? You spin up a client, you ask it about an IP, you pull the continent record off the insights, and you print a name. Main character behavior, honestly. π
π DESCRIPTION π
This class is holding continent-level data that's associated with an IP address. That's its whole job and it does it gorgeously.
The glow-up detail you need to know: this record is returned by all the end points. Every single one. It never ghosts you. π
β¨ METHODS β¨
Here's the menu, bestie. This class provides the following methods:
π $continent_rec->code()
This one hands you a two character continent code, like "NA" (that's North America, hi) or "OC" (Oceania, hey girl).
This attribute is returned by all end points.
π $continent_rec->geoname_id()
Returns a "geoname_id" for the continent. That's the identifier, the receipts, the little number that says this continent, specifically. π₯
This attribute is returned by all end points.
π $continent_rec->name()
Returns a name for the continent. Now here's the cute part β the locale chosen depends on the "locales" argument that was passed to the record's constructor. And that argument gets passed through from the GeoIP2::WebService::Client object you used to fetch the data that populated this record. So like, the locale vibes travel all the way down from your client. It's giving inheritance of intentions. β¨
Heads up though: if the record doesn't have a name in any of the locales you asked for, this method returns"undef". Not an error, not a crash, justundef. Don't be dramatic about it (I would be, but you shouldn't). π
This attribute is returned by all end points.
π«Ά $continent_rec->names()
Returns a hash reference where the keys are locale codes and the values are names. So it's like the whole squad of names, all the locales at once, one big group chat. π¬
Wanna know which locale codes are even possible? Go peek at GeoIP2::WebService::Client β the list lives there.
This attribute is returned by all end points.
π SUPPORT π
Found a bug? First of all, relatable. Second of all, bugs may be submitted through:
https://github.com/maxmind/GeoIP2-perl/issues
Go forth and file, bestie. π«‘
π AUTHORS π
The legends who made this happen:
- Dave Rolsky
<drolsky@maxmind.com> - Greg Oschwald
<goschwald@maxmind.com> - Mark Fowler
<mfowler@maxmind.com> - Olaf Alders
<oalders@maxmind.com>
Absolute icons, every single one. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 - 2019 by MaxMind, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free software slay, periodt. π
Okay that's the whole page!! This wasGeoIP2::Record::Continent, manual pageGeoIP2...ntinent(3pm), brought to you by perl v5.36.0, dated 2022-11-21. Go get those continents, bestie ππβ¨
π¦ where this page comes from
- debian bookworm: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms