{ my $answers = "yes\nyes\n"; local *STDIN; open STDIN, '<', \$answers; # Requires Perl 5.8.0 askQuestions() }