Geo::IP::Record(3pm)

๐ŸŽ€ Geo::IP::Record ๐Ÿ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and it's all about Geo::IP::Record โ€” the lil' object that holds all your city info from the GeoIP Legacy City Edition. iykyk.


โœจ NAME โœจ

Geo::IP::Record โ€” it's giving ๐Ÿ“ contains city information for GeoIP Legacy City Edition ๐Ÿ“


๐ŸŒธ SYNOPSIS ๐ŸŒธ

here's the whole vibe in one go, no cap:

use Geo::IP;

my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD);

my $record = $gi->record_by_addr('24.24.24.24');

print $record->country_code,
  $record->country_code3,
  $record->country_name,
  $record->region,
  $record->region_name,
  $record->city,
  $record->postal_code,
  $record->latitude,
  $record->longitude,
  $record->time_zone,
  $record->area_code,
  $record->continent_code,
  $record->metro_code;

open the db, grab a record for an IP, print literally everything. main character energy fr fr ๐Ÿ‘‘


๐Ÿ’… DESCRIPTION ๐Ÿ’…

so basically, Geo::IP::Record is the object that holds all your location info, and it gets handed to you by the GeoIP Legacy City database. ๐Ÿ™๏ธ

and the best part? it works with both of these, no drama:

  • the commercial GeoIP Legacy City database ๐Ÿ’ฐ
  • the free GeoLite Legacy City database ๐Ÿ†“

๐Ÿฆ‹ OBJECT METHODS ๐Ÿฆ‹

every single one of these is a method you call on your $record. collect them like stickers. ๐ŸŒˆ

  • $code = $record->country_code; โ€” hands you the ISO 3166 country code from the location object. ๐ŸŒ
  • $code3 = $record->country_code3; โ€” hands you the ISO 3166 3 letter country code from the location object. โœจ
  • $name = $record->country_name; โ€” hands you the country name from the location object. ๐Ÿณ๏ธ
  • $region = $record->region; โ€” hands you the region code from the location object. ๐Ÿ—บ๏ธ
  • $region = $record->region_name; โ€” hands you the region name from the location object. ๐Ÿ’œ
  • $city = $record->city; โ€” hands you the city from the location object. ๐Ÿ™๏ธ
  • $postal_code = $record->postal_code; โ€” hands you the postal code from the location object. ๐Ÿ“ฎ
  • $lat = $record->latitude; โ€” hands you the approximate latitude of the location tied to that IP address. โš ๏ธ and bestie listen โ€” this value is not precise and it should not be used to identify a particular address or household. like, do not do that. ๐Ÿ™ˆ
  • $lon = $record->longitude; โ€” hands you the approximate longitude of the location tied to that IP address. โš ๏ธ same warning, same energy: this value is not precise and it should not be used to identify a particular address or household. ๐Ÿ’€
  • $time_zone = $record->time_zone; โ€” hands you the time zone from the location object. ๐Ÿ•
  • $area_code = $record->area_code; โ€” hands you the area code from the location object โ€” and heads up, this one's for city-level US locations only. ๐Ÿ‡บ๐Ÿ‡ธ
  • $metro_code = $record->metro_code; โ€” hands you the metro code from the location object โ€” also city-level US locations only. ๐Ÿš‡
  • $continent_code = $record->continent_code; โ€” hands you the continent code from the location object. the possible continent codes are AF, AS, EU, NA, OC, SA, which stand for Africa, Asia, Europe, North America, Oceania and South America. ๐ŸŒŽ๐ŸŒ๐ŸŒ

โญ VERSION โญ

1.51


๐Ÿซถ AUTHOR ๐Ÿซถ

Copyright (c) 2016, MaxMind LLC

All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ๐ŸŽ€


okay that's the whole page!! this was rendered with perl v5.42.3 on 2026-08-19, and it's the Geo::IP::Record(3pm) situation, mwah ๐Ÿ’‹ go get those coordinates bestie, but remember โ€” approximate only, no doxxing, periodt. โœจ๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from