in reply to Reg Ex to find IP address in range

I recommend using NetAddr::IP to make your life much easier, and your code more readable.

from the docs:

use NetAddr::IP; my $ip = new NetAddr::IP 'loopback'; if ($ip->within(new NetAddr::IP "127.0.0.0", "255.0.0.0")) { print "Is a loopback address\n"; }
The module also has many other functions for defining and scanning subnets.