in reply to Comparing two hashes-help

I'll admit that your question is not very clear to me, but I think I see a problem with your hashes. Inside your while loop, you keep assigning just a single key/value pair to your hash (clobbering any old keys), whereas you probably want to keep adding keys to your hash:
%genotype=($1=>$2,);

print out your hash after your while loop to see what I mean (using Data::Dumper):

use Data::Dumper; print Dumper(\%genotype);

Maybe you want something like this:

$genotype{$1} = $2;

Since you are new to Perl, maybe the Basic debugging checklist will come in handy. Tips # 1, 2, 4, 7 and 10 may apply here.

If that is not your problem, you should include a very small sample of your input data.