Geo-IPinfo Geo::IPinfo is an object oriented perl library to use geolocation services provided by http://ipinfo.io EXAMPLE use Geo::IPinfo; my $token = "1234567"; # if you have a valid token, use it my $ipinfo = Geo::IPinfo->new($token); # or, if you don't have a token, use this: # my $ipinfo = Geo::IPinfo->new(); # return a hash reference containing all IP related information my $data = $ipinfo->info("8.8.8.8"); if (defined $data) # valid data returned { print "Information about IP 8.8.8.8:\n"; for my $key (sort keys %$data ) { printf "%10s : %s\n", $key, $data->{$key}; } print "\n"; } else # invalid data obtained, show error message { print $ipinfo->error_msg . "\n"; } # retrieve only city information of the IP address my $city = $ipinfo->field("8.8.8.8", "city"); print "The city of 8.8.8.8 is $city\n"; INSTALLATION This module requires the following modules: - LWP::UserAgent - JSON To install Geo::IPinfo, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc Geo::IPinfo You can also look for information at: RT, CPAN's request tracker (report bugs here) http://rt.cpan.org/NoAuth/Bugs.html?Dist=Geo-IPinfo AnnoCPAN, Annotated CPAN documentation http://annocpan.org/dist/Geo-IPinfo CPAN Ratings http://cpanratings.perl.org/d/Geo-IPinfo Search CPAN http://search.cpan.org/dist/Geo-IPinfo/ LICENSE AND COPYRIGHT Copyright (C) 2017 ipinfo.io Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at L Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.