Why do I get here with Devel::Peek::Dump two different results?
#!/usr/bin/env perl
use warnings;
use 5.014;
use utf8;
binmode STDOUT, ':encoding(utf-8)';
use Devel::Peek;
my %hash1 = ( 'müller' => 1 );
say Dump $_ for keys %hash1;
my %hash2;
$hash2{'müller'} = 1;
say Dump $_ for keys %hash2;
Output:
SV = PV(0x753270) at 0x76d230
REFCNT = 2
FLAGS = (POK,pPOK,UTF8)
PV = 0x759750 "m\303\274ller"\0 [UTF8 "m\x{fc}ller"]
CUR = 7
LEN = 8
SV = PV(0x753270) at 0x7d75a8
REFCNT = 2
FLAGS = (POK,FAKE,READONLY,pPOK)
PV = 0x799110 "m\374ller"
CUR = 6
LEN = 0
Both of those scalars contain exactly the same string. The only difference is only in how the string is stored internally.
My guess is that the key is normalised to make comparisons easier when trying to locate the key in the hash.