A hash is good at getting the value from a key. A hash is not good at getting the key from a value which is what you propose to do.
If all your keys are consequtive numbers you might as well use an array. Even better would be using a hash with key and values switched, i.e. your key is the value and your value is the key. That way, you can just check if your values in file2 exist as keys in the hash (which is the exactly the operation hashes are built for)
In reply to Re: Read file in a hash and compare the 'values' from file 2
by jethro
in thread Read file in a hash and compare the 'values' from file 2
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |