STDERR is not necessarily the same thing as file descriptor 2 (and it isn't after you do *STDERR = *OLDERR;). For commands executed by system, file descriptor 2 is stderr. They have no knowledge of the file descriptor associated with your program's STDERR variable.
Replace
*STDERR = *OLDERR;
with
open STDERR, ">&OLDERR";
Update: s/3/2/g. Thanks nobull.
In reply to Re: Suppress/Reactivate STDERR
by ikegami
in thread Suppress/Reactivate STDERR
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |