Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
foreach $host (@ARGV) { ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($host); #gethostbyname IS A PERL function? print "$host:\n"; foreach $a (@addrs) { $i = join(".", unpack("C4", $a)); if( ! $i ) { print ">>>>>>$i<<<<<<\n"; print "NOT FOUND\n"; } else { print "$i\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hostname from ip
by bart (Canon) on Oct 02, 2003 at 14:24 UTC | |
|
Re: hostname from ip
by jeffa (Bishop) on Oct 02, 2003 at 13:27 UTC | |
by grinder (Bishop) on Oct 02, 2003 at 15:19 UTC | |
|
Re: hostname from ip
by tachyon (Chancellor) on Oct 02, 2003 at 15:22 UTC |