Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/doc/perl-Geo-IP/example/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/perl-Geo-IP/example/region.pl
#!/usr/bin/perl

use strict;
use warnings;

use Test;

use Geo::IP;

my $gi = Geo::IP->open(
    "/usr/local/share/GeoIP/GeoIPRegion.dat",
    GEOIP_STANDARD
);

while (<DATA>) {
    chomp;
    my ( $country, $region ) = $gi->region_by_name($_);
    print join( "\t", $_, $country, $region ) . "\n";
}

__DATA__
12.10.1.4
66.108.94.158
yahoo.com
amazon.com
4.2.144.64
202.6.131.17

Hry