print "Valid IP\n" if 4 == grep { /^\d+$/ and $_ < 256 } split /\./, $ip;