|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Traverse an unknown multi-dimensional hashby Anonymous Monk |
| on Jul 12, 2007 at 09:45 UTC ( #626183=perlquestion: print w/ replies, xml ) | Need Help?? |
|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
Hi everyone,
Say you had an unknown hash structure and you didnt know how many dimensions to it there were. By dimension I mean child hashes, so it could be HoH, HoHoH, HoHoHoH, and so on, you just dont know. How would you traverse this hash to print out all key => value pairs. The only way I know how is a series of for loops, however that would mean you have to know in advance how deep it goes. Any help is greatly appreciated, thanks in advance, Mich.
Back to
Seekers of Perl Wisdom
|
|