Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Error handle Net::Whois::Raw

by edatawiz (Novice)
on Apr 18, 2009 at 09:17 UTC ( #758424=perlquestion: print w/replies, xml ) Need Help??

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

I am using Net::Whois::Raw.

I have enabled the following:
$Net::Whois::Raw::OMIT_MSG = 1;
$Net::Whois::Raw::TIMEOUT = 10;
$Net::Whois::Raw::CHECK_FAIL = 1;
I call the module by my $dominfo = whois($list1) It often fails if the url is in unknown format or at times says whois.crsnic.net: Unknown error: whois.crsnic.net:43 at C:/Perl/site/lib/Net/Who is/Raw.pm line 235

eval {...} called at C:/Perl/site/lib/Net/Whois/Raw.pm line 232
This error "
eval {...} called at C:/Perl/site/lib/Net/Whois/Raw.pm line 232
" is what I often see.
How do I make sure the code skips such errors and continue checking the next domain without dying.
Vishy

Replies are listed 'Best First'.
Re: Error handle Net::Whois::Raw
by Anonymous Monk on Apr 18, 2009 at 09:43 UTC
    my $dominfo; my $onesuccess = eval { $dominfo = whois($list1); 1}; if( $onesuccess ){ ... } else { log("failed for { $list1 } : $@"); next; }
      my $dominfo; next unless eval { $dominfo = whois($list1); 1 }; ...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2022-08-18 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?