1Geo::IP::Record(3) User Contributed Perl Documentation Geo::IP::Record(3)
2
3
4
6 Geo::IP::Record - Contains city information for GeoIP City Edition
7
9 use Geo::IP;
10
11 my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD);
12
13 my $record = $gi->record_by_addr('24.24.24.24');
14
15 print $record->country_code,
16 $record->country_code3,
17 $record->country_name,
18 $record->region,
19 $record->region_name,
20 $record->city,
21 $record->postal_code,
22 $record->latitude,
23 $record->longitude,
24 $record->time_zone,
25 $record->area_code,
26 $record->continent_code,
27 $record->metro_code;
28
30 Geo::IP::Record represents objects containing location information
31 returned by the GeoIP City database. It works with both the commercial
32 GeoIP City and free GeoLite City databases.
33
35 $code = $record->country_code;
36 Returns the ISO 3166 country code from the location object.
37
38 $code3 = $record->country_code3;
39 Returns the ISO 3166 3 letter country code from the location
40 object.
41
42 $name = $record->country_name;
43 Returns the country name from the location object.
44
45 $region = $record->region;
46 Returns the region code from the location object.
47
48 $region = $record->region_name;
49 Returns the region name from the location object.
50
51 $city = $record->city;
52 Returns the city from the location object.
53
54 $postal_code = $record->postal_code;
55 Returns the postal code from the location object.
56
57 $lat = $record->latitude;
58 Returns the latitude from the location object.
59
60 $lon = $record->longitude;
61 Returns the longitude from the location object.
62
63 $time_zone = $record->time_zone;
64 Returns the time zone from the location object.
65
66 $area_code = $record->area_code;
67 Returns the area code from the location object (for city-level US
68 locations only)
69
70 $metro_code = $record->metro_code;
71 Returns the metro code from the location object (for city-level US
72 locations only)
73
74 $continent_code = $record->continent_code;
75 Returns the continent code from the location object.
76 Possible continent codes are AF, AS, EU, NA, OC, SA for Africa, Asia, Europe, North America, Oceania and South America.
77
79 1.21
80
82 Copyright (c) 2008, MaxMind LLC
83
84 All rights reserved. This package is free software; you can
85 redistribute it and/or modify it under the same terms as Perl itself.
86
87
88
89perl v5.12.0 2009-05-17 Geo::IP::Record(3)