#!/usr/bin/perl -w use Net::Ping; use strict; my @hosts = qw(www.gellyfish.com petunia.gellyfish.com); my $ping = Net::Ping->new('icmp'); foreach my $host ( @hosts ) { if ( $ping->ping($host) ) { print "$host OK\n"; } }