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;