I would probably use something like:
while (ask('databasetype','Database type?','mysql')) { last if (grep {getConf('databasetype') eq $_} @databases); output "Sorry, invalid option\n\n"; }
And the ask() would return true if the user replied to the question and false if he accepted the default (no need to validate the default I guess) or pressed CTRL+D/CTRL+Z (end of input).
Jenda
In reply to Re: On goto
by Jenda
in thread On goto
by zachlipton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |