Hello
I am porting a very simple script from Python to Perl using the GeoIP2. Module and database (GeoLite2-Country.mmdb) are correctly installed. But how do I get the country name starting from an IP? In Python is as simple as
response = reader.city('128.101.101.101') response.country.name
My Perl code
use GeoIP2::Database::Reader; my $ip = ('128.101.101.101'); my $reader = GeoIP2::Database::Reader->new(file => 'GeoLite2-Country.m +mdb'); my $record = $reader->country($ip);
In reply to GeoLite2 get country name from IP by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |