use warnings; use strict; my %hash; open FILES,"Final.txt"or die "Can not open file"; while(){ chomp $_; my @words; @words=split(/\t/,$_); my $len=scalar(@words)-1; $hash{$words[$len]}=$words[0]; } open FILE,"output.txt" or die "Can not open file";
open OUT, ">cladeST.txt" or die "Can not open file Final.txt"; while(){
chomp $_; my @word; @word=split(/\t/,$_); print OUT "$_\t$hash{$word[-1]}\n"; }