- or download this
use NetAddr::IP ();
...
print("$_$/")
foreach @hosts;
- or download this
my @hosts = map {
my $pre = "192.168.$_.";
map { $pre.$_ } 1..254
} 0..255;
- or download this
my @hosts;
foreach (0..255) {
...
push(@hosts, $pre.$_);
}
}
- or download this
my $octet = join(',', 1..254);
my @hosts = glob("192.168.{0,$octet,255}.{$octet}");