##
perl -e 'my @t=qw/banana plum apple strawberry pea/;my $fruit="apple";my %in;undef @in{@t};print ((exists $in{$fruit})?"yes":"no");'
yes
####
perl -e 'my @t=qw/banana plum apple strawberry pea/;my $fruit="apple";for my $f (@t) {next if $fruit ne $f;print "yes";last}'
yes
####
#no, not efficient