I have a hash that looks like this:
{ bmw => { id => 1, color => brown } }
{ mercedes => { id => 2, color => black } }
I want to reverse this hash in perl so that I just get a mapping of id => name_of_car. Do I need to use the reverse function somehow?
Note: I can always iterate through the original hash and assign the keys and values accordingly in the new hash, nut I wanted to know if there was a slicker way.