in reply to Perl question, icmp script.

GrandFather has covered it pretty well.

Might I suggest you take a look at the tutorials and the code catacombs for some examples on "friendlier" code?