Hello,
The simplest way to do this is to first find the max length of the
numbers:
my @ar1 = qw/116 44 45 49 71/;
my @ar2 = qw/1 1 3 5 1/;
my $max = length ((sort {$b <=> $a} (@ar1,@ar2))[0]); # assuming all
#unsigned
printf "%${max}d " x @ar1 . "\n" , @ar1;
printf "%${max}d " x @ar2 . "\n" , @ar2;
Hope this helps,,,
Aziz,,,
In article <[EMAIL PROTECTED]>,
"Liger-Dc" <[EMAIL PROTECTED]> wrote:
> I have a formatting question:
> I have 2 arrays with integers that I want to print, with one array above
> the other so that the matching entries end up in the same column.
> Currently they look like..
>
> 116 44 45 49 71
> 1 1 3 5 1
>
> and I want them to look like
>
> 116 44 45 49 71
> 1 1 3 5 1
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]