Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Adding an Entire Class B IP Range to an Array

by ambs (Pilgrim)
on Mar 31, 2005 at 16:52 UTC ( #443885=note: print w/replies, xml ) Need Help??


in reply to Adding an Entire Class B IP Range to an Array

My first idea. Not small, but works.
my @hosts = map q|192.168.| . $_, 1..254; @hosts = map { my @h; my $ip = $_; push @h, "$ip.$_" for (1..254); @h } @hosts; for (@hosts){ print "$_\n"; }

Alberto Simões

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2023-12-10 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (40 votes). Check out past polls.

    Notices?