foreach $octet (split /\./, $ipaddr) { # # check each octet here (numerically, not with # a regex!), i've gotta jet # or i'd write it myself # }