#!/usr/bin/perl -w
use strict;
use Net::Whois::IANA;
my $ip;
if (defined ( $ARGV[0]) ) {
    $ip = $ARGV[0];
}
else {
    print "usage: $0 [ip]\n";
    exit;
}
my $iana = new Net::Whois::IANA;
$iana->whois_query(-ip=>$ip);
print "Country: " . $iana->country() . "\n";
print "Netname: " . $iana->netname() . "\n";
print "Descr: "   . $iana->descr()   . "\n";
print "Status: "  . $iana->status()  . "\n";
print "Source: "  . $iana->source()  . "\n";
print "Server: "  . $iana->server()  . "\n";
print "Inetnum: " . $iana->inetnum() . "\n";
print "CIDR: "    . ${$iana->cidr()}[0]    . "\n";
