|There's more than one way to do things|
Globs and globalsby Eyck (Priest)
|on Jan 25, 2005 at 07:41 UTC||Need Help??|
Eyck has asked for the wisdom of the Perl Monks concerning the following question:
I've been bitten by a side effect, here's example code from documentation of Net::SSLeay::Handle:
This works OK, unfortunatelly I used it in a library inside object, so when you brought two life multiple such objects
the whole shebang failed miserably (the last invocation of $object hides every other SSLeay::Handle (there is only one \*S2)
Now I'm trying to fix the code, here's my attempt which seems to work at the moment:
AFAIK this works because every $io=new IO::Handle generates unique identifier, so my code above might be replaced with
and it would still work, and wouldn't depend on chance (I hope two IO::Handle->new()don't get the same identifier).
What is the proper solution to this? How should I use Net::SSLeay::Handle?