Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: IP Iterator

by camlet (Novice)
on Apr 18, 2008 at 22:32 UTC ( [id://681595]=note: print w/replies, xml ) Need Help??


in reply to Re^3: IP Iterator
in thread IP Iterator

your recommeded solution worked also for subnet level increases. thank you. making the change now.
10.0.1.252 10.0.1.253 10.0.1.254 10.0.1.255 10.0.2.0 10.0.2.1 10.0.2.2 10.0.2.3 10.0.2.4 10.0.2.5
script:
sub ip_fr_dotted { unpack 'N', pack 'C4', split /\./, $_[0] } sub ip_to_dotted { join '.', unpack 'C4', pack 'N', $_[0] } my $start = ip_fr_dotted('10.0.0.200'); my $end = ip_fr_dotted('10.0.2.23'); for (my $ip=$start; $ip<=$end; $ip++) { print(ip_to_dotted($ip), "\n"); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-29 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found