[Perlmonks-pm] how to redirect STDOUT back to /dev/tty

Raymond Turney raymond_turney at yahoo.com
Fri May 25 15:35:25 PDT 2007


Hi,

I am redirecting STDOUT to a file in order to store the output of a system command, unfortunately I want it back and am having trouble getting it redirected back to /dev/tty:


 open(STDOUT, ">/tmp/dkimkey.pem");

    my @args=("/usr/bin/openssl", "x509", "-inform", "pem", "-in",

    "/tmp/09.pem", "-pubkey", "-noout");

    system(@args)==0 or die "system @args failed: $?";  

    close (STDOUT);

    open  (STDOUT, “>/dev/tty”);



I have also tried "/dev/tty" in the second open without 
redirection. Neither works


Pretty clearly I'm missing something.

Any help available would be much appreciated.

                             Ray, 





 
---------------------------------
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/perlmonks-pm/attachments/20070525/0cf74969/attachment.html 


More information about the Perlmonks-pm mailing list