use Perl, capture the output of a packet count limited ping command
Why wouldn't you just use Net::Ping instead of wasting time executing an external command with the possibility of misinterpreting its output?
_________________________
Bitt Faulk