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/country_v6.pl
#!/usr/bin/perl

use strict;
use warnings;

use Geo::IP;

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

die "Please install the CAPI for IPv6 support\n" unless $gi->api eq 'CAPI';

while (<DATA>) {
    chomp;
    my ($cc) = $gi->country_code_by_addr_v6($_) || '';
    print join( "\t", $_, $cc ) . "\n";
}

__DATA__
::24.24.24.24
2001:4860:0:1001::68
2002:1818:1818::
2001:638:500:101:2e0:81ff:fe24:37c6

Hry