in reply to Re: redirecting STDERR, then back again
in thread redirecting STDERR, then back again

Using local hides this for you => one less damned thing to go wrong.

Unfortunately, copying file descriptors using symbol table globs doesn't work very well with the underlying IO subsystem.

You're code reopens Perl's STDERR but the original STDERR is hanging around, hidden by local. This means the file descriptor 2 is left open so that your new Perl STDERR won't be "stderr" to C routines nor to child processes. So several things that would work as expected if you used the more complicated method recommended by the documentation won't work with your method.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: redirecting STDERR, then back again