%GID = map { $temp[0] => $temp[1] } @temp;
This assigns two elements to %GID, throwing away all other items in that hash that might been in there before. Not what you want. Instead, just write $GID{$temp[0]} = $temp[1].
There's also no reason to build the @list1 and @list2 arrays. Finally you can get rid of %GID completely by first iterating over <FH2> and building %CVDgenes, and then iterate over <FH1> directly.
In reply to Re: hash lookup
by moritz
in thread hash lookup
by dr_joe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |