The stupid question is the question not asked | |
PerlMonks |
tc1364's scratchpadby tc1364 (Beadle) |
on Oct 11, 2004 at 17:34 UTC ( [id://398225]=scratchpad: print w/replies, xml ) | Need Help?? |
Here is my question, I need to compare the keys and values between two hashes and log where the differences are to include the reporting hash, key and value. Can you please provide me some assistance? I did look at the information at http://perlmonks.thepen.com/1825.html but was not able to peice enough of it together. What I have done is use my Perl Cookbook to write the below code. It would be great to use hashes instead. %seen = (); foreach $item (@eadas58b) { $seen{$item} = 1 } foreach $item (@eadas58a) { unless ($seen{$item}) { print "Section 58 Inconsistent Data: $item\n"; } } %seen = (); foreach $item (@eadas153b) { $seen{$item} = 1 } foreach $item (@eadas153a) { unless ($seen{$item}) { print "Section 153 Inconsistent Data: $item\n"; } } |
|