sub paths { my $paths_ref = shift; while ( my ($k,$v) = each %$paths_ref) { my $l=$root->lookup($k); if ($l->is_container) { if ($l->has_children) { foreach my $c($l->children) { my $c_ref = {}; $paths_ref->{$c} = $c_ref; paths($paths_ref->{$c}); } } else { $paths_ref->{$k} = undef; } } else { $paths_ref->{$k} = undef; } } }