How about grep. A hash is probably best, but if you are stuck with an array, grep is the simplest way to check.
$x=grep /^c$/,@array_I_just_created_here;
Assigning the results of grep in a scalar context returns number of matches. $x == 0 means it's not in the array.
HTH
In reply to Re: Checking a string's presence within an array.
by pzbagel
in thread Checking a string's presence within an array.
by antirice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |