in reply to walking a hash

Sounds like homework to me. So, just a minimal solution.
sub r; sub r {map {my $__ = $_; $_, map {"$__.$_"} r ${$_[0]}{$_}} keys %{$_[ +0]}}
Call the sub with your hashref.