How about this? (using printf)
#!\Perl\bin\perl
#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..
#
@ar1 = qw(116 44 45 49 71);
@ar2 = qw(1 1 3 5 1);
#
#and I want them to look like
#
#116 44 45 49 71
# 1 1 3 5 1
#
foreach (@ar1) {
printf "%3u", $_;
}
print "\n";
foreach (@ar2) {
printf "%3u", $_;
}
----- Original Message -----
From: "Liger-dc" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 1:52 PM
Subject: Really really new
> 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
>
> The problem with using write & format STDOUT is that the number of
elements in each array chanes
> every time the program is run.
>
> I know this might be really silly but I'm really stuck. Thanks for any
advise or suggestions.
>
>
> =====
> Edson Manners
> Academic Computing & Networking Services
> Florida State University
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]