in reply to Re^3: Hash w/ multiple values + merging
in thread Hash w/ multiple values + merging

Thanks guys, you are really helping me out here. Now I need to find out the duplicates and merge two data sets for these duplicates while discarding the unmatched ones. I used the following script to find out the duplicates, and it indeed found the common keys.
foreach (do { my %matcher; @matcher{map lc,keys %hash1}=(); grep exists $matcher{lc $_},keys %hash2; }) { print "$_ matches\n"; }
yet I would like to merge the two data sets, so am I doing totally wrong by bothering with the matches as an extra loop? is there a way to merge two hashes conditional on common keys?