I've file file1.pl
:
use strict;
use warnings;
use Encode;
my @flist = `svn diff --summarize ...`;
foreach my $file (@flist) {
my $foo = "$one/$file";
use bytes;
print(bytes::length($one)."\n");
print(bytes::length($file)."\n");
print(bytes::length($foo)."\n");
}
# 76
# 31
# 108
and file2.pl
with the same main logic. But in file2.pl
the output is:
# 76
# 31
# 110 <-- ?
Both files have the same encoding (ISO-8859-1). For the same result as in file1.pl
I've to use
my $foo = "$one/".decode('UTF-8', $file);
in file2.pl
. What could be the reason for that difference or the requirement of decode('UTF-8', $file)
in file2.pl
? Seems to be related to What if I don't decode? but in which manner and only in file2.pl
? Thx.
Perl v5.10.1