X7ROOT File Manager
Current Path:
/usr/share/doc/perl-Geo-IP-1.43/example
usr
/
share
/
doc
/
perl-Geo-IP-1.43
/
example
/
📁
..
📄
benchmark.pl
(1.65 KB)
📄
city.pl
(594 B)
📄
country_v6.pl
(400 B)
📄
geolite-mirror-simple.pl
(1.71 KB)
📄
netspeed.pl
(430 B)
📄
netspeedcell.pl
(164 B)
📄
org.pl
(597 B)
📄
region.pl
(331 B)
Editing: city.pl
#!/usr/bin/perl use Geo::IP; my $gi = Geo::IP->open( "/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD ); while (<DATA>) { chomp; my $r = $gi->record_by_name($_); if ($r) { print join( "\t", $r->country_code, $r->country_name, $r->city, $r->region, $r->region_name, $r->postal_code, $r->latitude, $r->longitude, $r->metro_code, $r->area_code ) . "\n"; } else { print "UNDEF\n"; } } __DATA__ 12.10.1.4 0.0.0.0 66.108.94.158 yahoo.com amazon.com 4.2.144.64 24.24.24.24 80.24.24.24
Upload File
Create Folder