Where|How do you populate @wrds ("words" is not too long to type, mind you) before entering the while loop?
In if($word = @wrds[$w]), as $w is never being incremented & remains undefifned, $word is assigned undef every time. Use eq operator to test equality of strings (== to test equality of numbers).
To match a user given word in a pre-populated array, iterate over the array of words inside the trial loop.
In reply to Re: matching a word a in array of words
by Anonymous Monk
in thread macthing a word a in array of words
by zarlag
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |