well, from the errors that you described, $peer_host is blank.
since peer_host is set with
gethostbyaddr($ipaddr, AF_INET), I changed that line to
$peer_host = gethostbyaddr($ipaddr, AF_INET) || die "$!"; so I could see what happens when it dies.
unfortunately, it just returned "unknown error", so that's not much help.
I think this may be due to a win32 problem, or something similar. Have you considered checking out
IO::Sockets?