use strict; use warnings; use CGI; use Net::Whois::Raw; use Net::Whois::ARIN; my $q = new CGI; my $domname = $q->param("domname"); my $ip = $q->param('ip'); print "content-type:text/plain; charset=utf-8\n\n"; if (!$domname) { print ""; } else { my $text = get_whois($domname, undef, "QRY_LAST"); print $text; } my $w = Net::Whois::ARIN->new( host => 'whois.arin.net', port => 43, timeout => 30, ); if (!$ip) { print ""; } else { my @records = $w->network($ip); foreach my $net (@records) { # print ...; } }