As
jjdraco mentions above, the
Net::Ping module is a good one to use for this, and would greatly simplify your script. One thing to note however, is that you might need to be the root user on some *nix systems, if you are sending ICMP packets. Otherwise, you can use UDP by default.
TStanley
--------
It is God's job to forgive Osama Bin Laden. It is our job to arrange the meeting -- General Norman Schwartzkopf