Yes, the tree can be arbitrarily deep and each leaf terminates with an empty hash ref, so recursion is needed.
Thanks for the example - it's a great starting point. If I understand it correctly, though, I'll need to change it slightly. Specifically, it looks like foo() is the criteria test, but it appears that only the keys pointing to the terminal leaves will be tested. I need to test all keys in between, too, so I'll pull that out of the else. That also means that the for loop need not be buried in the 'if' block, so I can remove the 'if' conditional. Finally, I need to track the matching paths, so I could use foo() (or similar) to do that.
Thanks again.
In reply to Re^2: Recursive traversal of a HoH... and paths
by bobf
in thread Recursive traversal of a HoH... and paths
by bobf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |