in reply to ping with perl

In addition to the concrete points mentioned by the others, you may want to investigate Net::Ping. Somewhat more advanced is AnyEvent::Ping, which can ping multiple adresses in parallel, but its usage is not as straightforward for somebody not yet familiar with AnyEvent. Also, AnyEvent::FastPing, which even uses its own OS thread to send and receive the packets in the background, and which also has rate limiting.