in reply to compare text file and print occurrence of key and value
It is a bit difficult to understand what you want to do. But, assuming I nonetheless understood, one solution is to reverse the hash: read all you hash values, use the values as keys, and store the keys as values. But because hash can't have duplicate keys, you'll need either to push the original keys onto an sub-array (using a hash of arrays), or to concatenate the keys as strings in the new hash. At the end of the process, you go through the new hash.
|