#!/perl/bin/perl -w use strict; use Net::Ping; my $host = "127.0.0.1"; my $ping=Net::Ping->new("icmp"); if ($ping->ping($host,1)){ print "$host is alive"; }else{ print "$host unreachable" }