Re: multi-column array

2011-12-01 Thread Jeswin
On Thu, Dec 1, 2011 at 5:32 AM, Rob Dixon wrote: > > If I am understanding you correctly then there is no need for anything > so convoluted as your transpose subroutine. The program below does what > you need. > > HTH, > > Rob > > > use strict; > use warnings; > > my @unknown_abs = ( 0.1, 0.2, 0.3

Re: multi-column array

2011-12-01 Thread Rob Dixon
On 30/11/2011 23:06, Jeswin 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 = $

Re: multi-column array

2011-12-01 Thread Dermot
On 30 November 2011 23:06, Jeswin 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 { >

Re: multi-column array

2011-11-30 Thread David Christensen
On 11/30/2011 03:06 PM, Jeswin 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. sub transpose { map { my $i = $_; [ map $_->[ $i ], @_ ] } 0 .. $#{ $_[0] } } print "@$_\n" for transpose \( @

Re: multi-column array

2011-11-30 Thread Jim Gibson
On 11/30/11 Wed Nov 30, 2011 3:06 PM, "Jeswin" scribbled: > 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*

Re: multi-column array

2011-11-30 Thread Shlomi Fish
On Wed, 30 Nov 2011 18:06:50 -0500 Jeswin 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 tra