in reply to IP list generation
my @range = map { unpack "N", pack "C4", split /\./ } qw(10.0.70.1 10. +1.50.20); print "@range\n"; # the numbers themselves print $range[1]-$range[0]+1, "\n"; # how many addresses for ($range[0]..$range[1]) { print join(".", unpack "C4", pack "N", $_), "\n"; }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IP list generation
by ryan (Pilgrim) on Feb 16, 2001 at 23:00 UTC | |
|
Re: Re: IP list generation
by $code or die (Deacon) on Apr 28, 2001 at 21:39 UTC |