in reply to Pinging multiple hosts
Minimal example code from an old script (assuming *NIX/Linux here):
#!/usr/bin/perl -l use strict; use warnings; die "Usage: $0 <net>\n" unless @ARGV == 1; # Rudimentary check on the argument (my $net=shift) =~ s/\.0+$/./ or die "Supply an IP of the form <#.#.#.0>\n"; print "Begun pings at " . localtime; my @p; open $p[$_], "-|", "ping $net$_ -c 10" or die "Couldn't start ping for $net$_: $!\n" for 1..255; shift @p; undef $/; print map <$_>, @p; __END__
|
|---|