> Can anybody explain?
use utf8 ! :)
update
Without utf8 flag you are forcing perl to transliterate a 2 byte character to a 1 byte character.
My interpretation is that this 1 byte char is doubled to keep the counters in sync.¹
update
same effect here
use warnings;
use strict;
#use utf8;
$_ = '§|§';
print y/§/$/r, "\n";
Careful with such experiments, I was able to make my Perl (5.14) coredump
update
¹) ikegami's explanation is better, you are transliterating the first and second byte for · separately to .
DB<123> unpack 'H*','·'
=> "c2b7"
Got confused about the tr flags and their defaults.
|