in reply to DNS resolver
Obviously, you'll want to validate the IP address.#/usr/bin/perl use warnings; use strict; use Socket; print "Ip address "; my $ipaddr = <STDIN>; my $peer_host = gethostbyaddr(inet_aton($ipaddr), AF_INET); print $peer_host;
The errors were caused by inet_ntoa expecting a packed IP address for an argument.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|