$samplehash{$key} is a hashref. You're accessing its keys with $samplehash{$key}{$subkey}.
I'd recommend using Data::Dumper to see the entire contents and structure of %samplehash. I suspect that when you visualise the whole data structure, the reasons for your output will become apparent.
-- Ken
In reply to Re: Print the key of the first hash table in hash of hashes
by kcott
in thread Print the key of the first hash table in hash of hashes
by sundeep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |