I can't help but thinking your inner loop is unnecessary. You're scanning through your list of mappings until you find the one for the current line. But you're missing the beauty of hashes - direct access to the value you want..
Consider this:
while (<INPUT2>) {
$_ =~ s/[\r\n]+\z//s; # I don't use chomp, sorry
my ( $bioC, $contig_id, $pip ) = split( "\t", $_ );
my $origin = $origins{$contig_id};
print RESULTS "$bioC\t$origin\t$pip\n";
}
Update: you could also DIE with an error message in the event that the file contained a code that wasn't in your mapping table:
my $origin = $origins{$contig_id};
if ( ! defined( $origin ) ) {
die( "No mapping for \"$contig_id\" found in origins table" );
}