$a[0] = "a" ; $a[1] = "c" ; $a[2] = "abc" ; $a[3] = "b" ; ($f) = grep {$a[$_] =~ /^abc$/} 0..$#a) ? 1 : 0; if ( $f ) { print "YES\n" ; }