Apache2::GeoIP is a Perl module to look up country by IP Address.
IP ADDRESS TO COUNTRY DATABASES
Free monthly updates to the database are available from
http://www.maxmind.com/download/geoip/database/
This free database is similar to the database contained in IP::Country, as well as many paid databases. It uses ARIN, RIPE, APNIC, and LACNIC whois to obtain the IP->Country mappings.
For Win32 users, the GeoIP.dat database file is expected to reside in the /Program Files/GeoIP/ directory.
If you require greater accuracy, MaxMind offers a Premium database on a paid subscription basis.
Product's homepage
Requirements:
· Perl