in reply to testing against an array
2. fastif( grep{$test eq $_} @array ){ # }
You can use '==' instead of 'eq' if the elements are numericforeach (@array) { next unless $_ eq $test; #here is a match # ... last; }
my %test @test{@array} = (); foreach (@many_test_values) { if (exists $test{$_}) { # here is a match } }
|
|---|