It's funny how people go to the ends of the Earth and back
again to do something as simple as validate an IP address,
and they don't even handle all possible valid addresses.
use Socket;
sub IsValidIP
{
return $_[0] =~ /^[\d\.]*$/ && inet_aton($_[0]);
}