Module in Perl for WorldIP-database
Thanks to Craig MacKenna, there is the module IP::World for WorldIP base in CPAN.
Today it is the fastest module for access to IP database. At Athlon64 2.4GHz are 236K req/sec; XEON E5405 2Ghz - 267K req/sec
The installation is very simple:
Today it is the fastest module for access to IP database. At Athlon64 2.4GHz are 236K req/sec; XEON E5405 2Ghz - 267K req/sec
The installation is very simple:
cpan -i IP::World
In your Perl programs it can be used as follows:
use IP::World;
my $ipw = IP::World->new(0);
print $ipw->getcc("123.45.67.89");
Or you can take a small command line utility ip2country based on this module, either interactively or in the command line:
echo "3.4.5.6" | ./ip2country
./ip2country 3.4.5.6
Along with the module, there is an utility maint_ip_world_db, it checks the currency of the database. It's enough to put it in the monthly/weekly cron.