if ($pingObj->ping($IpAddress, 1)){ my $MachineName = uc(gethostbyaddr (inet_aton($IpAddress), AF_INET)) or "[FAILED]"; my $Host = ($MachineName =~ /^(.*?)(-UDP\w*\.|\.)(.*)/i)[0]; $Host = "$IpAddress" . "[NULL]" if ($MachineName eq ""); print "$IpAddress\t$Host" if $VERBOSE; } else { print "$IpAddress\tNo Response\n" if $VERBOSE; } }