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

Re: Re: Re: testing for ip resolutions of a hostname

by idnopheq (Chaplain)
on Aug 28, 2001 at 18:10 UTC ( [id://108530]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: testing for ip resolutions of a hostname
in thread testing for ip resolutions of a hostname

Ah! The lightbulb dimly illuminates!

Howzabout wrapping the lookup functions in a sub and replacing the 'die's with returns. Untested, BTW ... hopefully no typos ...

my $ip = lookup ( $host ) or warn "Cannot resolve $host!\n"; sub lookup { my $host = shift; my $i = gethostbyname($host) or return undef; my $ip = inet_ntoa($i) or return undef; return $ip; }

HTH
--
idnopheq
Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://108530]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.