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"; }
In reply to Re: split hash into two columns
by davidrw
in thread split hash into two columns
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |