my @keys = sort { $hash{$b} <=> $hash{$a} || $b cmp $a } keys %hash; my @col1 = splice(@keys, 0, $#keys/2+1); my @col2 = @keys; while (@col2) { my $key1 = shift(@col1); my $key2 = shift(@col2); printf "%s => %s\t%s => %s\n", $key1, $hash{$key1}, $key2, $hash{$key2}; } while (@col1) { my $key1 = shift(@col1); printf "%s => %s\n", $key1, $hash{$key1}; }