On Wed, 30 Nov 2011 18:06:50 -0500
Jeswin <[email protected]> wrote:
> I've been trying to figure out how to print 2 arrays into 2 columns. I
> came across this code and it works but gives me a problem in the
> output.
>
> *************************BEGIN
> CODE*********************************************
> sub transpose {
> map { my $i = $_; [ map $_->[ $i ], @_ ] } 0 .. $#{ $_[0] }
> }
> print "@$_\n" for transpose \( @unknown_abs, @unknown_conc );
>
> *************************END
> CODE************************************************
>
> *************************BEGIN
> OUTPUT******************************************
>
> 0.1
> 0.729843646443355
> 0.2
> 1.47255203636502
> 0.35
> 2.58661462124751
> 0.33
> 2.43807294326318
> 0.41 3.03223965520051
>
> *************************END
> OUTPUT*********************************************
>
> So 0.1, 0.2, 0.35, 0.33, 0.41 should be in one column and the other
> values next to it. I'm trying to figure out how to reduce precision
> with printf but not really sure about that.
>
Can you give some sample data for us to try? Please provide a self-contained
example code.
Regards,
Shlomi Fish
> Thanks
>
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
My Favourite FOSS - http://www.shlomifish.org/open-source/favourite/
There is no IGLU cabal! The former cabalists are trying to prove the
correctness of a program that proves the correctness of proofs of other
programs.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/