use Bio::SeqIO; my (%all_V1, %all_V2); # hashes to store $V1 and $V2 open (LIST1, "list"); while () { ($V1, $V2) = split /\t/; $all_V1{$V1}++; # FIX: this line and the next were originally $all_V2{$V2}++; # incorrectly prefixed with "push". } close(LIST1); my $seqIO_object = Bio::SeqIO->new(-file=>"infile.gb"); my $seq_object = $seqio_object ->next_seq; for my $feat_object ($seq_object->get_SeqFeatures){ if ($feat_object->primary_tag eq "CDS"){ if ($feat_object->has_tag('locus_tag')){ for my $V3 ($feat_object ->get_tag_values('locus_tag')){ if (exists $all_V1{$V3}){ print "locus_tag: ", $V3, " is unique\n"; } } } } }