As pzbagel noted, you need =~ to match against your regex, although I'd modify your regex to be /^y(es)?$/ to allow for both 'yes' and 'y' as valid answers.
Alternately, and if 'yes' is the ONLY valid answer, then you can use an eq comparison by forcing the case of your input with lc().
if( lc($test) eq 'yes' ) { ... }
--k.
In reply to Re: Case insensitive string compare
by Kanji
in thread Case insensitive string compare
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |