my $output = system("/bin/ping -c 1 2>&1> /dev/null $HOST"); if ($output) { print "Could not ping host."; } else { print "Ping successful.\n"; }