Geo::IP

This is an open source part of the commercial package by MaxMind.

Includes database that maps ip blocks to countries. The database is more correct and accurate than reverse DNS lookups.

The commercial versions include databases for ISP and town detections.

use Geo::IP; my $gi = Geo::IP->new; print $gi->country_code_by_addr('62.219.78.149'), "\n"; # 'IL'