I have Hash where values of keys are other Hashes.
Example: {'key' => {'key2' => {'key3' => 'value'}}}
How can I iterate through this structure?
I have Hash where values of keys are other Hashes.
Example: {'key' => {'key2' => {'key3' => 'value'}}}
How can I iterate through this structure?
This is not really a new answer but I wanted to share how to do more than just print all the hash values recursively but also to modify them if needed.
Here is my ever so slight modification of the dave4420's answer in which the value is passed to the callback as a reference so my callback routine could then modify every value in the hash.
I also had to rebuild the hash as the while each loop creates copies not references.
Is this what you want? (untested)
This post may be useful.