use warnings; use strict; use Net::Ping; my @hosts = qw( www.ovidinexile.com www.yahoo.com 127.0.0.1 www.perlmonks.org ); my $p = Net::Ping->new(); foreach my $host ( @hosts ) { print "$host\t" . $p->ping( $host ) . "\n"; }