Over a million developers have joined DZone.

IP2Location Perl Module

DZone's Guide to

IP2Location Perl Module

Free Resource
IP2Location Perl Module is a pure Perl API to support all IP2Locationâ„¢ database products. This API is meant to allow easy integration between your program written in Perl and 
the IP2Location Binary (.BIN) data file which will allow you to query the data for information like Country, Region, City, ISP, Latitude, Longitude, Domain, ZIP code, Time zone, ISP, Domain name, Connection type, Area Code and Weather station code.  It has been optimized for speed and memory utilization. Developers can use the API to query all IP2Locationâ„¢ binary databases for applications written in Perl. Please visit http://www.ip2location.com/perl.aspx for the perl module download and database download. Get more geolocation information at http://www.ip2location.com .

use Geo::IP2Location;

my $countryshort = $obj->get_country_short("");
my $countrylong = $obj->get_country_long("");
my $region = $obj->get_region("");
my $city = $obj->get_city("");
my $latitude = $obj->get_latitude("");
my $longitude = $obj->get_longitude("");
my $isp = $obj->get_isp("");
my $domain = $obj->get_domain("");
my $zipcode = $obj->get_zipcode("");
my $timezone = $obj->get_timezone("");
my $netspeed = $obj->get_netspeed("");
my ($countryshort, $countrylong, $region, $city, $latitude, $longitude, $zipcode, $timezone, $isp, $domain, $netspeed) = $obj->get_all("");

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}