my %hash = ( S => [1,2], B => [4,6],); print qq($_: @{$hash{$_}}\n) for sort keys %hash; --output--(Notice, it IS sorted)-- B: 4 6 S: 1 2