Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Extracting columns from a two dimensional array

by Aristotle (Chancellor)
on Dec 21, 2004 at 14:34 UTC ( [id://416480]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $row ( @array ) {
        $hash{ $row->[ 6 ] } = $row->[ 7 ];
    }
    
  2. or download this
    foreach my $i ( 0 .. $#array ) {
        $hash{ $array[ $i ][ 6 ] } = $array[ $i ][ 7 ];
    }
    
  3. or download this
    my %hash = map { $row->[ 6 ] => $row->[ 7 ] } @array;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found