Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Net::Whois sometimes fails

by nop (Hermit)
on Apr 04, 2003 at 20:58 UTC ( [id://248185]=perlquestion: print w/replies, xml ) Need Help??

nop has asked for the wisdom of the Perl Monks concerning the following question:

Hi. The following code sometimes runs, but often fails with with the message
Registrant Name not found in returned information at C:/Perl/site/lib/Net/Whois.pm line 301. .
Can someone explain why this code doesn't run consistently, and how to fix it? Thanks --
sigma
use strict; use Data::Dumper; use Net::Whois; my $url = 'www.yahoo.com/'; $url =~ m/^([^\/]+)\//; $1 =~ m/([^.]+\.[^.]+)$/; my $domain = $1; print STDERR "$url\nhitting whois for $domain...\n"; my $w = new Net::Whois::Domain $domain; die unless $w and $w->ok; print join("\n", $w->domain, $w->name, $w->address, $w->country); if (my $c = $w->contacts) { for my $t (sort keys %$c) { print " $t:\t"; print map { "\t$_\t" } @{$$c{$t}}; } } print "\n";

Replies are listed 'Best First'.
Re: Net::Whois sometimes fails
by Ovid (Cardinal) on Apr 04, 2003 at 21:16 UTC
      I found I had the same experience Ovid observed with Net::Whois so I ended up using Net::Whois::Raw for an application I was working on and was pleased with the results.
Re: Net::Whois sometimes fails
by Mr. Muskrat (Canon) on Apr 04, 2003 at 21:15 UTC

    Changing my $w = new Net::Whois::Domain $domain; to
    my $w = new Net::Whois::Domain $domain or die "Can't connect to Whois server\n";
    should be sufficient to explain it to you. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://248185]
Approved by Mr. Muskrat
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-23 22:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found