Log::Parallel::Geo::IP - IP address to country code translation
use Log::Parallel::Geo::IP; local($Log::Parallel::Geo::IP::cc_stream_command) = "ssh my.computer cat my.cached.copy"; $cc = ip2cc("1.2.3.4"); start_ordered_ip2cc(); $integer = ip2int("1.2.3.4"); $cc = ordered_ip2cc("1.2.3.4");
This package does IP addres to country code translations. It does it based on a text file downloaded from http://software77.net/geo-ip/. It will automatically re-download the file every $Log::Parallel::Geo::IP::cc_update_freq days (default 3). If you're running this on multiple systems, download the file in a cronjob and distribute it.
http://software77.net/geo-ip/
$Log::Parallel::Geo::IP::cc_update_freq
It can do a lookup of a single address with a binary search of the file ip2cc() or it can bulk lookups if the requests come in IP address integer order. Start bulk lookups with start_ordered_ip2cc() and then do the lookups with ordered_ip2cc(). Bulk lookups are much faster when you have to do a lot of them.
ip2cc()
start_ordered_ip2cc()
ordered_ip2cc()
This package may be used and redistributed under the terms of either the Artistic 2.0 or LGPL 2.1 license.
To install Log::Parallel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Parallel
CPAN shell
perl -MCPAN -e shell install Log::Parallel
For more information on module installation, please visit the detailed CPAN module installation guide.