in reply to testing against an array

how about
my $ok=0; map ($_ eq $test?($ok=1):0,@array); unless ($ok) {....