Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Comparing contents of 2 Hashes of Hashes

by Trimbach (Curate)
on Aug 16, 2001 at 15:47 UTC ( #105338=note: print w/replies, xml ) Need Help??


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

Replies are listed 'Best First'.
Re: Re: Comparing contents of 2 Hashes of Hashes
by Tuna (Friar) on Aug 16, 2001 at 15:52 UTC
    Yes, way trimmed down! First, the code will populate HoH1 with locally generated config files. Once they are distributed to their respective hosts, we will calculate checksums after the transfer, populate HoH2, and compare.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://105338]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2023-01-27 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?