!~ will return true if the thing on the right does not match.
In your case, however, using unless seems more logical. Something like

exit unless (lc($answer) =~ /^[y|yes]$/)

should work. The ^ and $ are there to make sure that the string
contains nothing but ``y'' or ``yes''. Make sure that you do
chomp($answer) before running this, though, because the newline
character may break it.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to