Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Unicode strange behaviour as a key of hashby dave_the_m (Monsignor) |
on Aug 14, 2017 at 19:05 UTC ( [id://1197376]=note: print w/replies, xml ) | Need Help?? |
It appears to be a bug the optimisation of constant hash keys. The constant key string in $h{'Góry'} is being downgraded from utf8, whereas if you write my $g = 'Góry'; $h{$g} = 1; it works ok. Once the key is downgraded, you then run into the Unicode Bug. This can bypassed in pattern matches using the //u match modifier.
Dave.
In Section
Seekers of Perl Wisdom
|
|