http://qs321.pair.com?node_id=287329


in reply to Odd effects of mod_perl on IO::Socket or LWP::Protocol?

One possibility: the module Net::HTTPS, used by LWP::Protocol::https::Socket, uses one of IO::Socket::SSL or Net::SSL.

It chooses by looking to see if $IO::Socket::SSL::VERSION is defined (ie the module's already loaded) and uses that if so.

If not, it first tries Net::SSL, then IO::Socket::SSL only if that can't be loaded.

Outside of mod_perl, you'll get Net::SSL. Inside of mod_perl, if you are using IO::Socket::SSL elsewhere (and I know we are, since I know the code in question ;), you'll get it instead.

This happened to me once before, but at the time I didn't have the ambition to find out _why_ it didn't work when IO::Socket::SSL was used by the module. I just hacked around it (set $IO::Socket::SSL::VERSION to undef just long enough to fool it into using Net::SSL) and went on my way.

- Matt Riffle
  Sr. Systems Programmer, pair Networks, Inc.
  (although, I speak only for myself; code is untested unless otherwise stated)