{ ask('databasetype','Database type?','mysql'); my $found; # aside: I hate " = undef" foreach $cur (@databases) { if (getConf('databasetype') eq $cur) { $found = 1; last; } } unless ($found) { output "Sorry, invalid option\n\n"; redo; } }