我有一个需要过滤的哈希值。我确实找到了如何进行查找,但它没有回答我的问题。
假设我有一个这样的哈希哈希:
my %HoH = (
flintstones => {
husband => "fred",
pal => "barney",
town => "springfield"
},
jetsons => {
husband => "george",
wife => "jane",
"his boy" => "elroy",
},
simpsons => {
husband => "homer",
wife => "marge",
kid => "bart",
town => "springfield",
},
);
我可以说我想要斯普林菲尔德的所有市民。我希望在没有外人的情况下输出相同的哈希值。
my %HoH = (
flintstones => {
husband => "fred",
pal => "barney",
town => "springfield"
},
simpsons => {
husband => "homer",
wife => "marge",
kid => "bart",
town => "springfield",
},
);
这似乎很愚蠢,但无法弄清楚如何过滤结构。目标是在过滤后对 springfield 的所有人进行迭代。
我当然做了一些研究,我得到的最接近的是哈希切片。但它们看起来很可怕。