<?xml version="1.0" encoding="windows-1252"?>
<node id="830551" title="Re: A better way for walking through HoHoH ?" created="2010-03-24 09:12:50" updated="2010-03-24 09:12:50">
<type id="11">
note</type>
<author id="151991">
RMGir</author>
<data>
<field name="doctext">
Recursion to the rescue! :)
&lt;code&gt;
sub handleRefs
{
    my ($target, $keys_ar) = @_;
    if (ref $target eq "HASH") {
        foreach my $key(keys %$target) {
            handleHashOrElement($target-&gt;{$key},[@$keys_ar,$key]);
        }
        return;
    }

    if (ref $target eq "ARRAY") {
	print "ARRAY at @$keys_ar is [ @$target ]\n";
	return;
    }

    print "Value at @$keys_ar is $target\n";
}

handleRefs(\%rez, []);
&lt;/code&gt;
In reality, you'd probably pass in another sub reference which would be the action to invoke on the final values.
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-151991"&gt;
&lt;br&gt;Mike
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
830512</field>
<field name="parent_node">
830512</field>
</data>
</node>
