Align columns: Difference between revisions

m
Line 1,074:
 
sub columns {
my @lines = map {[split /\$/] =>} split /\n/ => shift;
local $_ = shift;
for my $col (0 .. max map {$#$_ =>} @lines) {
my $max = max my @widths = map {length $lines[$_][$col] =>} 0 .. $#lines;
for my $row (0 .. $#lines) {
my $pad = ($max - $widths[$row]) / 2;