because re-opening STDERR decouples perl's STDERR from the called C library's STDERR
It will probably work if you save/dup STDERR and restore it
open my $errsave, '>&', STDERR or do { print "couldn't dup STDERR: $!"; exit 2; }; open STDERR ... ... open STDERR, '>&', $errsave or do { print "couldn't restore/dup STDERR: $!"; exit 2; };
In reply to Re^3: STDERR going to string
by Anonymous Monk
in thread STDERR going to string
by philkime
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |