Why do I get after the "autodie" a different output?
#!/usr/bin/env perl
use warnings;
use 5.012;
use utf8;
use open ':encoding(utf-8)';
use open ':std';
open my $fh, '>', 'test.txt' or die $!;
say $fh 'k?se';
close $fh;
open my $fh1, '<', 'test.txt' or die $!;
while ( my $row = readline( $fh1 ) ) {
print $row;
}
close $fh1;
use autodie;
open my $fh2, '<', 'test.txt';
while ( my $row = readline( $fh2 ) ) {
print $row;
}
close $fh2;
# Output:
# k?se
# k?¤se
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…