my $done = 0; my $choice; my $rin = ''; vec($rin, fileno(STDIN), 1) = 1; my $timeout = 0; while (! $done) { print "Test\n"; if (select(my $rout=$rin, '', '', $timeout)) { chomp ( $choice = uc (<>)); $done = 1 if ( $choice eq "Q" ); } }