---
name: "Geo::IP::Record"
section: "3pm"
platform: "linux"
package: "perl-geoip"
version: "1.51-5"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Geo::IP::Record"
---

# Geo::IP::Record(3pm)

## NAME

```
  Geo::IP::Record - Contains city information for GeoIP Legacy City Edition
```

## SYNOPSIS

```
  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;
```

## DESCRIPTION

Geo::IP::Record represents objects containing location information returned by the GeoIP Legacy City database.  It works with both the commercial GeoIP Legacy City and free GeoLite Legacy City databases.

## OBJECT METHODS

- $code = $record-\>country\_code;

  Returns the ISO 3166 country code from the location object.

- $code3 = $record-\>country\_code3;

  Returns the ISO 3166 3 letter country code from the location object.

- $name = $record-\>country\_name;

  Returns the country name from the location object.

- $region = $record-\>region;

  Returns the region code from the location object.

- $region = $record-\>region\_name;

  Returns the region name from the location object.

- $city = $record-\>city;

  Returns the city from the location object.

- $postal\_code = $record-\>postal\_code;

  Returns the postal code from the location object.

- $lat = $record-\>latitude;

  Returns the approximate latitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household.

- $lon = $record-\>longitude;

  Returns the approximate longitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household.

- $time\_zone = $record-\>time\_zone;

  Returns the time zone from the location object.

- $area\_code = $record-\>area\_code;

  Returns the area code from the location object (for city-level US locations only)

- $metro\_code = $record-\>metro\_code;

  Returns the metro code from the location object (for city-level US locations only)

- $continent\_code = $record-\>continent\_code;

  ```
   Returns the continent code from the location object.
   Possible continent codes are AF, AS, EU, NA, OC, SA 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.
