Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: IP list generation

by $code or die (Deacon)
on Apr 28, 2001 at 21:39 UTC ( [id://76396]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://76396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-26 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found