Subject: | binmode and run3 interaction |
The following script outputs
#!/home/ben/software/install/bin/perl
use warnings;
use strict;
use IPC::Run3;
use utf8;
run3 (['/bin/ls'], undef, \my $out, \my $err);
binmode STDOUT, ':utf8';
my $s = 'シグネス';
print "$s\n";
-----output:
シグネス
-----
but the following creates an error:
#!/home/ben/software/install/bin/perl
use warnings;
use strict;
use IPC::Run3;
use utf8;
binmode STDOUT, ':utf8';
run3 (['/bin/ls'], undef, \my $out, \my $err);
my $s = 'シグネス';
print "$s\n";
-----output:
Wide character in print at test.pl line 9.
シグネス
-----
It seems like run3 does not restore STDOUT fully to its former state on
finishing.