my @array = qw(1 2 3 23 7 26); my $wert = 23; if(grep{$_ == $wert}@array){ print "yes\n"; } else{ print "no\n"; }