also, now as you renamed some of the variables, for convenience and speed their place should be changed back to what they were.

example, $cidrarray and $point (dot) should be defined at the very beginning if used with their own separate variable-names.
_________________________
!

download KiXnet