if (($ipaddress|$netmask)==$network) { # then $ipaddress is in the range $network/$netmask defines }