in reply to redirecting output to STDERR and STDOUT

To copy an already open filehandle into a scalar, you need to use a GLOB reference:
$logfile = \*STDERR;

print $logfile "This will go to STDERR now...";
  • Comment on Re: redirecting output to STDERR and STDOUT