in reply to Re^4: preserving hash value outside the loop -- silly oneliner
in thread preserving hash value outside the loop

which code is giving you always the same key? it seems not probable to me. In case post your code , your data and your output.

Here mines:

#cat gen1.txt @gi AGAT + AAAA 1:1.txt @gi CATT + AAAAA 3:1.txt #cat gen2.txt @gi AGAT + AAAA 1:2.txt @gi TACA + AAAA 2:2.txt perl -lane "BEGIN{$/=''}map{$h{$_}{s}.=' '.$F[4];$h{$_}{c}+=$1 if $F[ +4]=~/(\d+):/}join qq(\n),@F[0..3]; END{print map{qq($_ $h{$_}{c} $h{$_}{s}\n\n)} keys %h}" + gen1.txt gen2.txt @gi AGAT + AAAA 2 1:1.txt 1:2.txt @gi CATT + AAAAA 3 3:1.txt @gi TACA + AAAA 2 2:2.txt

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.