chomp( my @header_for_table1 = split /\t/, <$table1> ); @new_header_for_table1 = pop(@header_for_table1); print $table3 join "\t", @new_header_for_table1, "name1", "name2", "\n";