in reply to Re: IP list generation
in thread IP list generation

Great node. I had to modify the "for" loop for large IP addresses, e.g. starting with 128 and above.

I now use something like this:
my @range = map { unpack "N", pack "C4", split /\./ } ($ARGV[0], $ARGV +[1]); print "@range\n"; # the numbers themselves print $range[1]-$range[0]+1, "\n"; # how many addresses for (my $i = $range[0]; $i <= $range[1]; $i++) { print join(".", unpack "C4", pack "N", $i), "\n"; }
I was getting this error:
Range iterator outside integer range


$ perldoc perldoc