Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Building dynamic nested hash referencesby ryan (Pilgrim) |
on Jan 21, 2004 at 12:05 UTC ( [id://322849]=note: print w/replies, xml ) | Need Help?? |
Thanks ysth and broquaint, that does it nicely.
Now I know this follow-on question is really asking for another data structure like a linked list, but ... ... assuming I had the same information but wanted to step my way back *up* the 'tree' to find the parent hash of the item we found in this example, and then the parent of that etc, is there any way to do this on the hash I've displayed? The only way I can think of is to store references to each of the steps taken down the tree (when the item was initially found) in an array and query that? Update: or storing parent hash information in the tree itself as it is built? I really want a different data structure don't I? :) Ryan
In Section
Seekers of Perl Wisdom
|
|