((grep/^(Sun|Moon)$/, @arr1) == 2) ? (print "True") : (print "False");
This is not reliable if @arr1 is allowed to contain duplicates, it is deemed to give false positives and false negatives, and the OP wrote nothing about that possibility.
In reply to Re^2: using grep to match more than two words
by blazar
in thread using grep to match more than two words
by sroy5
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |