Hi All, I have a requirement in perl where i want to verify that the input value matches from any of the values in a array variable. can you please suggest how to achieve this. Please Find Below a sample code.
my $input_val = 'abc'; @names = ("abc", "def", "ijk"); if($input_val eq @names) {print "Match Found";} else { print "Match Failed";}
In reply to if Loop with array by mayank2211
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |