HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //usr/share/doc/perl-Geo-IP-1.43/example/org.pl
#!/usr/bin/perl

use Geo::IP;

# here we are using GeoIP ISP
my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPISP.dat", GEOIP_STANDARD);

# uncomment for GeoIP Organization
#my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPOrg.dat", GEOIP_STANDARD);

# uncomment for GeoIP Domain Name
#my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPDomain.dat", GEOIP_STANDARD);

while (<DATA>) {
  chomp;
  my ($org) = $gi->org_by_name($_);
  my $netmask = $gi->last_netmask;
  print join("\t",$_,$org, $netmask) . "\n";
}

__DATA__
12.10.1.4
66.108.94.158
yahoo.com
amazon.com
4.2.144.64
24.24.24.24