Problems? Is your data what you think it is? | |
PerlMonks |
Re: Case insensitive string compareby Kanji (Parson) |
on Aug 09, 2003 at 05:13 UTC ( [id://282379]=note: print w/replies, xml ) | Need Help?? |
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().
--k.
In Section
Seekers of Perl Wisdom
|
|