为什么我要带Devel :: Peek :: Dump两个不同的结果?
#!/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;
Run Code Online (Sandbox Code Playgroud)
输出:
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 = …Run Code Online (Sandbox Code Playgroud)