On Dec 20, 2004, at 6:06 PM, Michael G Schwern wrote:

use Test::Builder;
BEGIN {my $fh = Test::Builder->new->failure_output; binmode $fh, ':utf8';}


Test::Builder should do something like this internally, its not like anyone's
going to drive binary data through a TB filehandle. The question is
how does one do it without breaking older perls?

If there was a way to tell what mode was on STDERR before you duped it, you could just set it to the same. Something like:


  my $mode = what_binmode(STDERR);
  my $fh = $builder->failure_output;
  binmode $fh, $mode;

Is there a module or function in Perl that can provide this information?

Regards,

David



Reply via email to