#!/usr/bin/perl -w use strict; use Net::Ping; my $host; print "Host to ping? "; chomp( $host = ); my $p = Net::Ping->new(); if( $p->ping($host) ) { print "$host is alive!\n"; } else { print "$host appears to be dead.\n"; } $p->close();