use Net::Whois;
use Carp;
$dom="microsoft.com";
my $w = new Net::Whois::Domain $dom
or die "Can't connect to Whois server\n";
print "Content-type: text/html\n\n";
print "<html>\n";
print "Domain: ", $w->domain, "\n";
print "Name: ", $w->name, "\n";
print "Tag: ", $w->tag, "\n";
> use Net::Whois;
> use Carp;
> $dom="microsoft.com";
>
> my $w = new Net::Whois::Domain $dom
> or die "Can't connect to Whois server\n";
>
> print "Content-type: text/html\n\n";
> print "<html>\n";
> print "Domain: ", $w->domain, "\n";
> print "Name: ", $w->name, "\n";
> print "Tag: ", $w->tag, "\n";
Net::Whois の man (perldoc) のコード例を参考にしたようですが、or die ...
の次の行に
unless ($w->ok) { croak "No match for $dom"; }
を入れるのを忘れていますね。
そして、結果は、
No match for microsoft.com at ...
となるだけですが。
http://search.cpan.org/~dhudes/Net-Whois-1.9/
で見ればわかりますが、このモジュールは、1999年以来更新されておらず、ほと
んど役に立たなくなっているもののようです。Rating のコメントにもそのよう
なことが書かれています。
--
Masanori HATA
"Masanori HATA" <ha...@iname.com> wrote in message
news:ec32k1$2qq$1...@caraway.media.kyoto-u.ac.jp...