Hi sroy5, try this,
use strict; use warnings; my @arr1 = ("Sun", "Moon", "Venus", "Pluto", "Neptune"); ((grep/^(Sun|Moon)$/, @arr1) == 2) ? (print "True") : (print "False");
Anyway first look into these links How do I post a question effectively? & How (Not) To Ask A Question
Regards,
Velusamy R.
In reply to Re: using grep to match more than two words
by Samy_rio
in thread using grep to match more than two words
by sroy5
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |