in reply to Pinging multiple hosts

While I think that using a dedicated module, as duly pointed out by others, is the best solution, if you run an external ping utility you may gain something in terms of efficiency by parallelizing.

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__