http://qs1969.pair.com?node_id=105338


in reply to Comparing contents of 2 Hashes of Hashes

I'm assuming that the code you posted is a little stripped down from the real thing, because as written %localdigest and %remotedigest are guaranteed to be identical (you assign $digest to each hash one after the other without modifying $digest in between.)

Anyway, assuming the hashes are actually different, this ought to work:

foreach $clusterhost(@hosts) { foreach $file(@files) { if ($localdigest{$clusterhost}{$file} ne $remotedigest{$cluster +host}{$file}) { $error=1; print "The local $file on $clusterhost does not equal t +he remote $file.\n"; } } } if (!$error) { print "All files matched on all hosts.\n"; }

Gary Blackburn
Trained Killer