my @a = qw[one two]; my @b = qw[three four five]; my @c = qw[six seven]; printf +('%-10s 'x3) .$/ , $a[$_]||'', $b[$_]||'', $c[$_]||'' for 0 .. ( sort{ $b<=>$a } ~~@a, ~~@b,~~@c)[0]; one three six two four seven five