Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Comparing contents of 2 Hashes of Hashes

by Monky Python (Scribe)
on Aug 16, 2001 at 16:04 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-25 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found