in reply to testing against an array

There are two ways
1. simple
if( grep{$test eq $_} @array ){ # }
2. fast
foreach (@array) { next unless $_ eq $test; #here is a match # ... last; }
You can use '==' instead of 'eq' if the elements are numeric
Update: The third way can be useful if a great number of testing needed
my %test @test{@array} = (); foreach (@many_test_values) { if (exists $test{$_}) { # here is a match } }