in reply to How read ICMP UDP port unreachable?

If you want ot try an ICMP udp ping, it might be easier to use the Net::Ping module:
use Net::Ping; $p = Net::Ping->new("udp"); print "$host is alive.\n" if $p->ping($host); $p->close();

-Mark