use Net::CIDR::Set;
my $set = Net::CIDR::Set->new('192.168.0.1-192.168.0.254');
$set->contains('8.8.8.8'); # false
$set->contains('192.168.0.123'); # true
use Net::CIDR::Set;
my $set = Net::CIDR::Set->new('192.168.0.1-192.168.0.254');
$set->contains('8.8.8.8'); # false
$set->contains('192.168.0.123'); # true