debiandude has asked for the wisdom of the Perl Monks concerning the following question:
Is there a one liner for this? For some reason this implementation feels bad. Thanks.my @col1 = qw /A B C/; my $otherColumns = [ [ 1, 2, 3], [4, 5, 6] ]; my @rows; foreach my $i ( 0 .. $#col1) { push @rows, [ $col[$i], map { $_->[$i] } @$otherColumns ]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Column Data to Row Data
by BioLion (Curate) on Aug 24, 2010 at 15:42 UTC | |
by debiandude (Scribe) on Aug 24, 2010 at 15:49 UTC | |
|
Re: Column Data to Row Data
by JavaFan (Canon) on Aug 24, 2010 at 16:14 UTC |