我正在查看以下演示嵌套哈希的代码:
my %HoH = (
flintstones => {
husband => "fred",
pal => "barney",
},
jetsons => {
husband => "george",
wife => "jane",
"his boy" => "elroy", # Key quotes needed.
},
simpsons => {
husband => "homer",
wife => "marge",
kid => "bart",
},
);
为什么最上面的哈希(从第 1 行开始)是用括号初始化的,而子哈希是用花括号初始化的?
来自 python 背景我必须说 Perl 很奇怪:)。