#!/usr/bin/perluse warnings;use Net::Ping;$hostname = shift @ARGV;$p = Net::Ping->new("icmp"); #could be "udp" or "tcp" insteadprint "$host is alive.\n" if $p->ping($host);$p->close();