open IN, "$infile" or die $!; @lines = ; close IN; #get first line which will be the header line and keep only the titles we need (the column names) $header_line = shift (@lines); @split_header = split(/\t/, $header_line); shift (@split_header); #work with the rest of the input file for ($i=0; $i<=$#lines; $i++) { $method_line = $_; #lines with the methods and the results for each one @split_method = split(/\t/, $method_line); $method_name= shift (@split_method); #get only the name of the method push @methods, $method_name; push @AoA, [ @split_method ]; #keep the data } unshift @AoA, [ @methods ];