This is the path to the GeoIP2 database file which youd like to query.
This is an array reference where each value is a string indicating a locale. This argument will be passed on to record classes to use when their name() methods are called.
The order of the locales is significant. When a record class has multiple names (country, city, etc.), its name() method will look at each element of this array ref and return the first locale for which it has a name.
Note that the only locale which is always present in the GeoIP2 data in en. If you do not include this locale, the name() method may end up returning undef even when the record in question has an English name.
Currently, the valid list of locale codes is:
Passing any other locale code will result in an error.
The default value for this argument is [en].
All of the request methods accept a single argument:
This must be a valid IPv4 or IPv6 address. This is the address that you want to look up using the GeoIP2 web service.
Unlike the web service client class, you cannot pass the string me as your ip address.
CW$reader->connection_type()This method returns a GeoIP2::Model::ConnectionType object.
CW$reader->country()This method returns a GeoIP2::Model::Country object.
CW$reader->city()This method returns a GeoIP2::Model::City object.
CW$reader->domain()This method returns a GeoIP2::Model::Domain object.
CW$reader->isp()This method returns a GeoIP2::Model::ISP object.
CW$reader->anonymous_ip()This method returns a GeoIP2::Model::AnonymousIP object.
CW$reader->metadata()This method returns a MaxMind::DB:Metadata object containing information about the database.
In the case of a fatal error, the reader will throw a GeoIP2::Error::Generic object.
This error class has an $error->message() method and overload stringification to show that message. This means that if you dont explicitly catch errors they will ultimately be sent to STDERR with some sort of (hopefully) useful error message.
While many of the databases return the same basic records, the attributes which can be populated vary between model classes. In addition, while a database may offer a particular piece of data, MaxMind does not always have every piece of data for any given IP address.
Because of these factors, it is possible for any model class to return a record where some or all of the attributes are unpopulated.
See <http://dev.maxmind.com/geoip/geoip2/web-services> for details on what data each end point may return.
o Dave Rolsky <firstname.lastname@example.org> o Greg Oschwald <email@example.com> o Mark Fowler <firstname.lastname@example.org> o Olaf Alders <email@example.com>
This software is copyright (c) 2013 - 2015 by MaxMind, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|perl v5.20.3||GEOIP2::DATABASE::READER (3)||2015-06-29|