in reply to Re: IO::Socket::INET (dup?)
in thread IO::Socket::INET, threads, and screwy recv() results

That is most definitely not the problem actually. If you look closely, neither thread exits at all. The join() blocks until the threads finish so you have to SIGINT your way past the joins to close the socket.

Also, you can't my $sock : shared. I tried that. It generates a "stupid type to share" error or something like that.

Anyway ... Thanks for you input. I actually did try the things you suggested.