in reply to How can I print hash values when the keys are the values from another hash.
First, let's get rid of an abomination. Change
"${value}"
to
$value
The values in hashA are the keys in hashB.
$value contains a value from hashA. Just use $value as the key to hashB. Change
$hashB{$hashA{$value}}
to
$hashB{$value}
Maybe you were thinking of
$hashB{$hashA{$key}}
which also works.
|
|---|