use utf8 ! :)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
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.¹
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
¹) 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.
In reply to Re: y/·/./ gives two points instead of one
by LanX
in thread y/·/./ gives two points instead of one
by rsFalse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |