Help for this page

Select Code to Download


  1. or download this
    my @arr = (['a','b','c'],
               ['h','i','j'],
               ['x','y','z']);
    
    my @first_column = map $_->[0], @arr;
    
  2. or download this
    my @arr = (['a','b','c'],
               ['h','i','j'],
    ...
    for (map $_->[0], @arr) {
       # $_ now holds the current value of column 1 (index 0)
    }