for my $key1 ( sort keys %{ $excel_href } ) { while ( my ( $key2, $val2 ) = each %{ $excel_href->{ $key1 } } ) { print "$key2 = $value \n"; } }