The only problem I can possibly think of is hash redefinition. I can not stress enough the importance of use strict;

Try adding my %file1hash outside (before) the while block... As I see it now your hash is local to the while block and then it is declared again inside the next while. Hopefully I'm not misdirecting you... Jean SpectorSQA Engineer @ Exanetjean.spector@softhome.net

There are only 10 types of people in the world - Those who understand binary, and those who don't.

You need to use exists instead of defined. Defined works on the variable itself; since %file1hash has elements, it will always be defined. Exists checks for the existence of a key within the hash, which is what you want.

>> You need to use exists instead of defined. Defined works on the variable itself; since %file1hash has elements, it will always be defined. Exists checks for the existence of a key within the hash, which is what you want. <<

defined in the context used above checks whether the hash value is "defined", exists checks whether the hash key "exists".