foreach my $key (keys %csahash) { if(defined $cathhash{$key}) { print "$key matches. It's values are $csahash{$key} and $cathhash{$key}\n"; } }