in reply to New to Perl

It's a matter of opinion, but I believe insisting on solving with modules will hinder your ability to code. This one seems simple enough. Just convert to binary before comparing input with binary-converted limits of the range :-
my $limit1 = '101.0.0.0'; my $limit2 = '101.0.255.255'; my ($bl1,$bl2) = (cnvb($limit1),cnvb($limit2)); while (<>) { chomp; my $bin = cnvb($_); if ( $bin >= $bl1 and $bin <= $bl2 ) { print "$_\n"; } } sub cnvb { my @mask = split /\./, shift(); $#mask == 3 or die "bad IP address"; my $ret = 0; for my $i ( 0 .. 3 ) { $ret *= 256; $ret += $mask[$i]; } return $ret; }

One world, one people