in reply to Reverse DNS lookup on a list of ip addresses

Well I "forgot" how I solved this problem in the past.

When I searched perlmonks I found this thread, but I was not happy with the answers. Here is my simple non-CPAN way to solve this issue.
use Socket; foreach my $key ( keys %report ) { my $hostname="-= Not in DNS =-"; $hostname=gethostbyaddr(inet_aton($key), AF_INET) or $hostname="-= Not in DNS =-"; if ( $report{$key} > 0 ) { print "-=" x 2, " Host: $key ( $hostname )", "-=" x 2, "\n"; } else { print "ERROR Why is this in hash? $key\n"; } }