I tried to answer the question "How to print a hash in Perl, such that 3 key value pairs are printed on each line?" like this.
As I got an uncommented downvote, I'd like to ask: What's wrong with/How to improve:
use Modern::Perl;
my %h = ();
for (0..7) {
$h{$_} = chr(65 + $_);
}
print %h, "\n";
my $cols = +$ARGV[0] || 5;
my $n = -$cols;
for my $key (keys %h) {
print $key, ' => ', $h{$key}, 0 == ++$n % $cols ? "\n" : "\t\t";
}
print $n % $cols ? "\n------" : "------";