in reply to Get the difference between 2 Hashes

I would agree with ruzam that a recursive function is the way to handle this, given that the hashes can differ at any intermediate level of the structure, and a path that goes down 7 layers in one hash simply does not exist beyond the fourth layer in the other hash.

As for his remark about the problem with your sample data, I would take that a little further -- I wasn't really sure what your criteria are for the particular values you want as output:

Was that really your intention, or just a typo in the OP?

Anyway, I wonder if your hash structure really needs to have so many layers. Is there anything besides "MachineType" at the top level? Anything besides "Unit" at the third level? In other words, couldn't the structure really be like this:

$values{Blue_machine}{2}{0}{19} $values{Red_machine}{1}{0}{22} ...
For that matter, you could flatten this out, and make the comparisons trivially simple, by just concatenating the keys into a single string, instead of using them as separate layers:
$values{"Blue_2_0_19"} $values{"Red_1_0_22"} ...
How are you loading up the hash stuctures in the first place? (An xml parse? I suppose it might be easier in some sense to stick with the deep structure if that's the case, though I'd still look for a way to refactor the parsing to allow a flatter data structure.)