Why do you think you need a timeout? It is considered normal, polite behavior for your program to wait for STDIN to finish at most prompts.
Anyways, another solution to the "yes or no prompt defaulting to no" dilemma is Term::UI and Term::ReadLine (standard in Perl 5.10).
use strict;
use warnings;
use Term::UI;
use Term::ReadLine;
my $term = Term::ReadLine->new('test');
# Use default replies if not at interactive prompt
$Term::UI::AUTOREPLY = (-t STDIN) ? 0 : 1;
my $choice = $term->ask_yn(
prompt => 'Your answer?',
default => 'n',
);
print "You chose '$choice'\n";
code>