in reply to Recursive traversal of a HoH... and paths

If I understand you correctly, have you considered Data::Alias? This would allow you to copy results hash of "pointers" (or paths) to the data itself without altering the original data structure.

The results hash could look something like this: $results{"$VAR1->{'1'}->{'1a'}"} = "element1"; Your search could push results into that hash. This is way your result and your path are both accessible via the same hash.

To navigate a HoHoH, just do the following:

foreach my $a (keys %hash) { foreach my $b (keys %{$hash{$a}}) { print "$hash{$a}{$b}\n"; } }