Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Comparing contents of 2 Hashes of Hashes

by Monky Python (Scribe)
on Aug 16, 2001 at 16:04 UTC ( #105340=note: print w/replies, xml ) Need Help??


in reply to Comparing contents of 2 Hashes of Hashes

following should work:

foreach $host (keys %localDigest) { foreach $file (keys %{ $localDigest{$host} }) { if (exists $remoteDigest{$host}{$file}) { # replace with compare print "$localDigest{$host}{$file} = $remoteDigest{$host}{$file} +\n"; } else { print "file $host $file missing\n"; } } }

isn't it possible to compare your files,host and checksum in your original foreach loop, instead of building this complex hash structure?

MP

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2023-01-28 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?