in reply to Globs and globals

What is the proper solution to this?

The proper solution would be for Net::SSLeay::Handle to provide a new() method.

Absent that you solution using IO::Handle is probably the best except I'd probably simplfy $socket=\*$io to $socket=$io.