my @range = map { unpack "N", pack "C4", split /\./ } qw(0.0.0.0 255.255.255.255); #yes i know these aren't 'real' $hostcount = $range[1]-$range[0]+1; #number of IPs for (0..$hostcount-1) { #done this way to avoid problems #with large numbers in some #environments print join(".", unpack "C4", pack "N", $_+$range[0]); }