in reply to Getting keys of a hash element

Perhaps this example will help
foreach $key (sort keys %tophash) { foreach $subkey (sort keys %{$tophash{$key}}) { print "$key/$subkey = $tophash{$key}{$subkey}\n"; } }