You have three basic options:
- Iterate through the array, checking each element in turn. Don't use this method if you'll need to scan the array more than once or twice.
- Use grep. Good option if you only want to check part of each element.
- Turn your array into a hash. Use this method if you'd otherwise be using option #1 often.
This is a
Categorized Q&A, so see
How to find out if X is an element in an array?.