c has asked for the wisdom of the Perl Monks concerning the following question:
print "It doesnt resolve\n" unless ($ip);
I am toying around with the following code:
#!/usr/bin/perl -w use strict; use Socket; my $host = "noresolve"; my $i = gethostbyname($host); my $ip = inet_ntoa($i); print "Failure!\n" unless ( $ip );
humbly -c
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: testing for ip resolutions of a hostname
by idnopheq (Chaplain) on Aug 28, 2001 at 21:42 UTC | |
by c (Hermit) on Aug 28, 2001 at 22:01 UTC | |
by idnopheq (Chaplain) on Aug 28, 2001 at 22:10 UTC |