my $p = Net::Ping->new("icmp"); if ($p->ping($computer)) { #run your checks } else { print"* Unable to Ping $computer *\n"; } $p->close(); }