open AFH,"fileA" or die;
my %ahash;
while()
{
my ($id,$colD,$colE) = (split /\t/)[2,3,4];
$ahash{$id} = "$colD\t$colE";
}
close AFH;
open BFH,"fileB" or die;
while()
{
chomp;
chop if (/\r$/);
my ($id) = (split /\t/)[-1];
if (exists $ahash{$id})
{
print "$_\t$ahash{$id}\n";
}
else
{
warn "$id is not exists in fileA!\n";
}
}
close BFH;