The values you read from QUERYFILE contain the end of line characters, while your $ID does not, so $ID is not an exact match. You can try chomp @queries;, or maybe process all the input keys to make sure they match the expected format (ex: remove extra spaces, or have everything in uppercase).
Although defined would work in this case (because the value is 1), exists is the standard way of checking the presence of a key in a hash.
In reply to Re: Hash searching
by Eily
in thread Hash searching
by Oligo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |