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}; } #### my @col1; my @col2; my $t = 0; foreach (sort {$hash{$b} <=> $hash{$a} || $b cmp $a} keys %hash) { if ($t ^= 1) { push(@col1, $_); } else { push(@col2, $_); } } printf "%s\t%s\n", pop(@col1), pop(@col2) while @col2; printf "%s\n", pop(@col1) while @col1;