in reply to Net::Ping issues

I think it would be better to rewrite loop in the following way:
foreach $host (@host_array) { if( $p->ping($host, 2) ) { print "$host is alive.\n"; } else { print "$host is dead\n"; } }
Or you can face situation when some host dead and alive (if first ping fails and second successful) or neither dead nor alive (if first ping succeeds and second fails).