in reply to Like in hashes, do we have something like exists in arrays as well.

Yes. Grep.
my @a=('a' .. 'z'); print scalar grep {$_ eq "q"} @a;
...this is actually equivalent to a foreach loop, so don't do it for big arrays. There is no quick way to do that - if you must, use hashes instead. The above (last line) is more-or-less equivalent to:
my @foo; foreach (@a) { push @foo,$_ if ($_ eq "q"); } print scalar @foo;
HTH.

Originally posted as a Categorized Answer.