How to iterate through Hash (of Hashes) in Perl?

后端 未结 9 894
無奈伤痛
無奈伤痛 2020-12-08 03:20

I have Hash where values of keys are other Hashes.

Example: {\'key\' => {\'key2\' => {\'key3\' => \'value\'}}}

How can I iterate throug

9条回答
  •  心在旅途
    2020-12-08 03:52

    foreach my $keyname (keys(%foo) {
      my $subhash = $foo{$keyname};
      # stuff with $subhash as the value at $keyname
    }
    

提交回复
热议问题