How can I open() and close() STDERR in Perl?
perl, stderr
Solution
Why do you want to close STDERR?
You could put it aside...
open(FOO, ">/dev/null"); # or ">nul" on Windows
*TEMP = *STDERR;
*STDERR = *FOO;
... then
*STDERR = *TEMP;
Problem
Greetings , I can close the STDERR in perl using; ``` close(STDERR) ``` and after executing some logic , I want to open it back again. How can I do it? I tried ``` open(STDERR,">&STDERR"); ``` and didn't work. Thanks in advance.