I reviewed your code and that the char [tempbuff]="Hi", has a size of 2 therefore.. any string larger that this size wont be stored ...
Have u tried using one letter.. or even more... to increase this size ?
$socket = IO::Socket::INET->new(Proto => "udp") or die "Socket error: $@\n";
$ipaddr = inet_aton($host);
$portaddr = sockaddr_in($port, $ipaddr);
send($socket, $buf, 0, $portaddr) == length($buf) or die "Can't send: $!\n";
print "Now, '$host' must be dead : )\n";