ddeyoung has asked for the wisdom of the Perl Monks concerning the following question:
print $name = gethostbyaddr(192.168.1.1, AF_INET);
while (defined($line = <INPUT>)) { if ($line =~ /\b\d*\.\d*\.\d*\.\d*\b/) { $name = gethostbyaddr($&, 'tcp'); if (defined($name)) { print "hostname for address $&: $name\n"; }else{ print "Couldn't get hostname for: $&\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: novice falls
by kjherron (Pilgrim) on Oct 11, 2001 at 04:02 UTC | |
|
Re: novice falls
by wog (Curate) on Oct 11, 2001 at 03:41 UTC | |
by Fletch (Bishop) on Oct 11, 2001 at 08:18 UTC | |
|
Re: novice falls
by dws (Chancellor) on Oct 11, 2001 at 04:04 UTC | |
by tadman (Prior) on Oct 11, 2001 at 05:28 UTC | |
|
Re: novice falls
by dws (Chancellor) on Oct 11, 2001 at 08:47 UTC |