in reply to Case insensitive string compare
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.
|
|---|