use utf8;
my %x = (Привет => 1);
my($key) = keys %x;
die unless $key eq 'Привет';
perlcritic:
% perlcritic .
Problem while critiquing "foo.pl": Can't parse code: Encountered unexpected character '208'
It does work when I change it to 'Привет' => 1)
I admit to not being 100% certain that you can use a bare unicode key name like this, but the code does seem to work as intended. If so a more useful diagnostic would indicate where the character is located, if that is possible.
First reported with to
Perl::Critic
, since I wasn't sure if the problem was there or here. However, it seems to be reproducible withppidump
(see https://github.com/Perl-Critic/Perl-Critic/issues/948#issuecomment-809680380 ), so I believe this is indeed aPPI
issue.code:
perlcritic:
It does work when I change it to
'Привет' => 1)
I admit to not being 100% certain that you can use a bare unicode key name like this, but the code does seem to work as intended. If so a more useful diagnostic would indicate where the character is located, if that is possible.