in reply to Comparing Scalars and Arrays

If you're going to do it more than once, use a hash.
my %hash; @hash{@array} = (); ## or @hash{@array} = (1) x @array; if (exists $hash{$scalar}) { ## Matched. }
This is an FAQ. How can I tell whether a list or array contains a certain element?