Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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
Node Status?
node history
Node Type: note [id://443885]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2020-04-08 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (45 votes). Check out past polls.

    Notices?