I have following Perl code to prompt user for yes/no answer. If the user enters anything else than yes/no, keep prompting. No other word is acceptable. I don\'t know why thi
You should use following Perl regular expression for matching only yes or no (case insensitive):
yes
no
m/^(yes|no)$/i
For yes only, use:
m/^yes$/i