foreach $outerkey ( sort keys %hashofrecordset ) { print "\n$hashofrecordset{$outerkey}\n"; foreach $innerkey ( sort keys %{ $hashofrecordset{$outerkey} }) { print "\t$hashofrecordset{$outerkey}{$innerkey}\n"; } print "\n"; }