Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: compare text file and print occurrence of key and value

by Laurent_R (Canon)
on Sep 23, 2014 at 20:44 UTC ( [id://1101710]=note: print w/replies, xml ) Need Help??


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.
  • Comment on Re: compare text file and print occurrence of key and value

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1101710]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-24 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found