while () { chomp; my ($bioC, $contig_id, $pip) = split /\t/; if ( exists $origins{ $contig_id } ) { print RESULTS "$bioC\t$origins{$contig_id}\t$pip\n"; } }