Again, thanks for giving me a solution that will work. I'll put in conditional code if that's what it takes. I have just been surprised and pleased that I've been able to avoid it so far.
I've got a full GUI program with lots of widgets (in TK) and a lot of network-based functionality that is 95% complete, and working on both platforms using the same code. I wanted to see how close I could get to 100%, and didn't expect to get this far. But even if I've got to add conditional code to a subroutine, all the high-level code is still nice and clean. And that's good enough for me.
I am highly impressed with the response of the perlmonk community.