sub valid { (grep { (m/^(\d{1,3})$/ and $_ <= 255) or return 0 } split(/[.]/, shift)) == 4 }