I want to find whether the given ipaddress/hostname is present in the network.
I've tried the gethostbyname and when I give unavailable hostname, it is returning undef, but when I give unavailable ip address, it is returning the same IP.
use Socket; $packed_ip = gethostbyname shift; if (defined $packed_ip) { $ip_address = inet_ntoa($packed_ip); print $ip_address; } else { print "Host not exist\n"; }
In reply to To know the existence of an ip address by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |