Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Net::Whois sometimes fails

by nop (Hermit)
on Apr 04, 2003 at 20:58 UTC ( #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";

Comment on Net::Whois sometimes fails
Download Code
Re: Net::Whois sometimes fails
by Mr. Muskrat (Abbot) 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. :)

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.

Log In?
Username:
Password:

What's my password?
Create A New User
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? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (18)
As of 2015-07-07 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (89 votes), past polls