in reply to question on Arrays

Given what you are trying to accomplish, you should read How can I tell whether a certain element is contained in a list or array?, and possibly the whole Data: Arrays section of perlfaq4. It will help you understand how to use hashes.