in reply to how to find common and not common lines in 2 files?

So you want to go through hash1 and separate what's common from what's unique. Then you want to find the unique things in hash2.
my (@common, @uniq1, @uniq2); for (keys %hash1) { if (exists $hash2{$_}) { push @common, $_; delete $hash2{$_}; # All that will be left in hash2 is what wasn' +t in hash1 } else { push @uniq1, $_ } } @uniq2 = keys %hash2;

Caution: Contents may have been coded under pressure.