Possible Duplicate:
How can I check if a Perl array contains a particular value?
I have two arrays @array1 = (1..26);, @array2 = ('a'..'z'); and a variable $x. suppose $x=5 then how can I compare this value with two arrays and state in output that this variable belongs to @array1?
If you want to avoid the controversial smart-match operator, you can use
grep.You should be using hashes here if you do this repeatedly.