as for your code, why are you fork'ing? Is system (exec never returns -- system does) more what you're looking for? Or even just backticks (see perlop)?
open PING, ">>dummy";
print PING `ping $host`;
close PING;
You may be right about Net::Ping to work better than a system call. But it slightly differs from the ping-program. The default protocol for Net::Ping is tcp where ping uses icmp. The tcp-connection requires a running echo-service on the remote machine whereas the icmp-connection (usually) requires the icmp-packages not to be explicitly dropped.
With Net::Ping you can specify icmp as the connection method but this requires root permissions.