or download this
use Socket;
...
print "the value of checksum is:", unpack('H4', pack('n',32127)), "\n"
+;
print "[And you should see this in your tcpdump -i lo icmp -xxx]\n";
send(SOCK,$msg,0,sockaddr_in(0,inet_aton('localhost'))) || die "Error:
+ $! \n";