my (@b) = qw(un deux trois quatre jedan dva tri
tcheteri one two three );
####
my ($max) = sort {$b <=> $a} map length, @a;
####
my $col=4;
for(@b){ $_ = substr($_ . ' ' x $max, 0, $max +1)}
@a = @b;
for (;@a;){print splice (@a, 0, $col),"\n"}
####
@a = @b;
my @c;
for (;@a;){
my @b = splice (@a, 0, $col);
map {push @{$c[$_]}, $b[$_];
} (0 .. $#b);
}
map {print @$_,"\n"} @c;
####
use strict;
use warnings;
my (@a) = my (@b) = qw(un deux trois quatre jedan dva tri tcheteri one two three );
print "@a\n";
my ($max) = sort {$b <=> $a} map length, @a;
print "max=$max\n";
my $col=4;
for(@b){ $_ = substr($_ . ' ' x $max, 0, $max +1)}
@a = @b;
for (;@a;){print splice (@a, 0, $col),"\n"}
print "\ntrasnsposed\n\n";
@a = @b;
my @c;
for (;@a;){
my @b = splice (@a, 0, $col);
map {push @{$c[$_]}, $b[$_];
} (0 .. $#b);
}
map {print @$_,"\n"} @c;