IMHO recursive solutions are easier to write and maintain, I'd only translate them to iterative if performance mattered.
Point is you still need some kind of call stack* which needs to be simulated then.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
*) in this case the last positions in the tree and remaining keys for each sub hash.
In reply to Re^4: A more elegant way to filter a nested hash?
by LanX
in thread A more elegant way to filter a nested hash?
by jimpudar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |