Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Printing multiple arrays as multiple column

by tlm (Prior)
on Apr 12, 2005 at 12:58 UTC ( [id://446968]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub transpose {
      map { my $i = $_; [ map $_->[ $i ], @_ ] } 0 .. $#{ $_[0] }
    ...
    bc dd 34
    cd ee 56
    de gg 78
    
  2. or download this
    my @firsts  =   ( 1, 2, 3, 4 );
    my @seconds = qw( w x y z );
    ...
    
    my @foos = map foo( @$_ ), transpose \( @firsts, @seconds, @thirds );
    # @foos gets foo( 1, 'w', 5.6 ), foo( 2, 'x', 7.8 ), etc.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://446968]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found