in reply to Redirection and encoding, broken or WAD?
Of course this isn't talking about encodings, but I think it might be the same problem. Unless a PerlIO guru pops up here, I'd suggest asking p5p.Though if you try to re-open C<STDOUT> or C<STDERR> as an "in memory" file, you have to close it first: close STDOUT; open STDOUT, '>', \$variable or die "Can't open STDOUT: $!";
PS. If you just want a minimal demonstration script, you can delete most of your code:
# close STDOUT; # with this it works open STDOUT, ">:encoding(cp37)", "foo.out" or die "Cannot redirect STD +OUT\n"; print "yadda yadda\n";
|
|---|