| open(filename)
|
Open IP2Location binary database from a
local path. |
|
| get_country_short(ip_address)
|
Returns a short country name from ip address. |
|
| get_country_long(ip_address) |
Returns a full country name from ip address. |
|
| get_region(ip_address)
|
Returns a region name from ip address. |
|
| get_city(ip_address)
|
Returns a city name from ip address. |
|
| get_latitude(ip_address) |
Returns city's latitude name from ip address. |
|
| get_longitude(ip_address) |
Returns city's longitude name from ip address. |
|
| get_isp(ip_address) |
Returns an ISP name from ip address. |
|
| get_zipcode(ip_address)
|
Returns zip code from ip address. |
|
| get_timezone(ip_address)
|
Returns time zone from ip address. |
|
| get_netspeed(ip_address)
|
Returns connection type from ip address. |
|
| get_domain(ip_address)
|
Returns a domain name from ip address. |
|
| get_all(ip_address)
|
Returns an array of country short name, country long
name, region, city, latitude, longitude and domain name for an IP address. |
|
|
use Geo::IP2Location;
$obj =
Geo::IP2Location->open("IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ISP-DOMAIN.BIN");
my $countryshort = $obj->get_country_short("20.11.187.239");
my $countrylong = $obj->get_country_long("20.11.187.239");
my $region = $obj->get_region("20.11.187.239");
my $city = $obj->get_city("20.11.187.239");
my $latitude = $obj->get_latitude("20.11.187.239");
my $longitude = $obj->get_longitude("20.11.187.239");
my $isp = $obj->get_isp("20.11.187.239");
my $domain = $obj->get_domain("20.11.187.239");
my $zipcode = $obj->get_zipcode("20.11.187.239");
my $timezone = $obj->get_timezone("20.11.187.239");
my $netspeed = $obj->get_netspeed("20.11.187.239");
my ($countryshort, $countrylong, $region, $city, $latitude, $longitude,
$zipcode, $timezone, $isp, $domain, $netspeed) =
$obj->get_all("20.11.187.239");
|