perl hash ,hash 引用:
[ucd@hgagent perl]$ cat test.pl
%a=('a'=>1,'b'=>2);
print %a;
print "
";
[ucd@hgagent perl]$ perl test.pl
a1b2
[ucd@hgagent perl]$ cat test.pl
%a=('a'=>1,'b'=>2);
print %a;
print "
";
$b=\%a;
print $b;
print "
";
[ucd@hgagent perl]$ perl test.pl
a1b2
HASH(0x668618)
解hash引用:
[ucd@hgagent perl]$ cat test.pl
%a=('a'=>1,'b'=>2);
print %a;
print "
";
$b=\%a;
print $b;
print "
";
print %{$b};
print "
";
[ucd@hgagent perl]$ perl test.pl
a1b2
HASH(0x1d7d618)
a1b2