Subject: | RFE to Term::Prompt: should be possible to require user to answer |
Hi Allen
Just tried using Term::Prompt for the first time and it works fine :-) (I was previously using my own code for this and have started to replace it with yours.)
There is one feature which I was using in my own code that appears to be missing from Term::Prompt. I would like to be able to specify that the user be required to answer certain questions. There are two parts to this:
1) It should be possible to specify that an empty response (i.e. user just hits newline) is not acceptable. In that instance, the user should be asked to answer the question again. It would also be nice to set a limit on the number of times the user is asked before an exception is thrown.
2) (This would be especially useful for y/n questions.) Answers which do not match the list of legal answer should behave as in 1) (i.e. the user should be asked to try again).
As for the API, perhaps an undefined default parameter could indicate a required answer.
I am using Perl v5.8.0.
Cheers
Kevin