# this code works # loop.pl > loop.txt has > 0 bytes use Net::Ping; my $adr = "192.168."; my @net = qw / 97. 100. 102. 104. 105. 32. 33. 34. /; my ($i, $j, $host); for ($i=0; $i<=7; $i++) { HOST: for ($j=16; $j<=250; $j++) { $host = $adr . $net[$i] . $j; print "$host\n"; } }