use Net::CIDR::Lite; my $b = Net::CIDR::Lite->new( '218.0.0.0 - 221.255.255.255' ); print "Match!\n" if $b->find('216.23.234.32'); #### use Socket; my $ip1 = inet_aton('218.0.0.0'); my $ip2 = inet_aton('221.255.255.255'); my $ip3 = inet_aton('216.23.234.32'); print "Match!\n" if $ip1 <= $ip3 and $ip3 <= $ip2;