http://qs321.pair.com?node_id=291091


in reply to Redirecting STDERR to a variable

I had the same problem recently while writing a perlTk script. I found out it helped me to use the perl tie command.

tie(*STDERR, 'Tk::Text', $text); tie(*STDOUT, 'Tk::Text', $text); $SIG{'__WARN__'} = sub { print STDERR @_ };

You could also use the module Tie-STDERR. It has an option for:
use Tie::STDERR \$append_to_scalar;

good luck
Tie-bag
Sure there's more than one way, but one just needs one anyway - Teabag