Advertisement

06.05.2008 at 04:57AM PDT, ID: 23459817
[x]
Attachment Details

remember/restore reference to filehandle?

Asked by ravenpl in Perl Programming Language

I have this code

$newfh = IO::Socket::SSL->start_SSL( ...);
*STDIN = \*{ $newfh };
*STDOUT = \*{ $newfh };

and it's working fine, hence after session is over, the code
open(STDIN,  '</dev/null') || die "Can't read /dev/null  [$!]";
complains
Can't locate object method "OPEN" via package "IO::Socket::SSL::SSL_HANDLE"

OK, my idea is to remember previous STD* references, and restore them before opening the /dev/null ?

Possible? How? Or maybe there's better solution to my problem?Start Free Trial
 
Loading Advertisement...
 
[+][-]06.05.2008 at 06:18AM PDT, ID: 21718992

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.05.2008 at 11:26PM PDT, ID: 21726650

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 07:30AM PDT, ID: 21729405

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628