Help for this page

Select Code to Download


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