in reply to forking question

I think that the " for (<IPS>) " and the " for (@hosts) " are being run in each child as well as the work that the child needs to do. I just wanted to make sure this is the case before I get into a rewrite.

Don't rewrite on that account, your program is fine as far as that goes. The <IPS> loop is only run once, in the parent. The kids don't start up until that loop is done. The kids call exit when their job is done, so they don't go on to duplicate effort in the @hosts loop, either.

I do recommend a couple of changes, though. At minimum, you should check for definedness of $pid. If it is undefined, you are in the parent and fork failed. Your code shunts the parent into the child branch to exit in that case.

For a tidy and easy rewrite, look at Net::Ping and Parallel::ForkManager. The latter is very handy for limiting the number of concurrent forked processes, and it takes care of failures and child reaping fo you, too.

After Compline,
Zaxo