maybe be helpful to avoid the external creation of ping.txt.. Also, i would suggest adding
... to debug your problem of 0 alive and 0 dead, i would put a debugging print statement in the
loop to see what it's doing.. it's probably not matching on
so first step is to look at what string it's searching.. can you show us a snippet from ping.txt?
is a more "Perl-ish" way to write that first loop.