$baseIP = "10.0.5."; $j = 1; until ($j == 255) { $string = $baseIP.$j; $input = "-w 50 -n 1 ".$string." |find /V \"Received\" |find /V \"Ping\" |find /V \"A\""; system("ping $input >> ping.txt"); $j++; print "$j\n"; } open(RESULTS2, "ping.txt") || die; open(RESULTS, ">ping.txt") || die; @results = ; close(RESULTS2); $j = 1; $a = 0; $f = 0; while (@results) { if (m/Reply/) { $output[$j] = $baseIP.$j.": Alive\n"; $j++; $a++; } elsif (m/Request/) { $output[$j] = $baseIP.$j.": Dead\n"; $j++; $f++; } else { } } print RESULTS "Pinger Results:\n\n"; print RESULTS "Alive Nodes: $a\n"; print RESULTS "Dead Nodes: $f\n"; print RESULTS "\n\nDetailed Results:\n"; print RESULTS @output; close(RESULTS);