The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WWW::ipinfo - Returns your ip address and geolocation data using http://ipinfo.io

VERSION

version 0.01

SYNOPSIS

use WWW::ipinfo;

my $ipinfo = get_ipinfo();
my $city = $ipinfo->{city};

EXPORTS

Exports the get_ipinfo function.

FUNCTIONS

get_ipinfo

Returns a hashref containing your ip and geolocation data:

{
  ip        => "198.115.6.53",
  hostname" => "cpe-198-115-6-53.nyc.res.rr.com",
  city      => "New York",
  region    => "New York",
  country   => "US",
  loc       => "43.7805,-79.9512",
  org       => "Time Warner Cable Internet LLC",
  postal    => "11154"
}

Example

use WWW::ipinfo;

my $ipinfo = get_ipinfo();
my $ip = $ipinfo->{ip};

AUTHOR

David Farrell <sillymoos@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by David Farrell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.