in reply to split hash into two columns

and another approach:
my @keys = reverse sort {$hash{$a} <=> $hash{$b} || $a cmp $b} (keys % +hash); my @idx = ( ( map { $_, $_+1+$#keys/2 } 0..$#keys/2-1 ), $#keys%2?():$ +#keys/2 ); for(my $i=shift(@idx); defined $i; $i=shift(@idx) ){ print $keys[$i]; ($i = shift(@idx)) && print "\t" . $keys[$i]; print "\n"; }