Speakup and Term::ReadLine::Perl

Chris Brannon cmbrannon at cox.net
Sun Nov 30 21:26:57 EST 2008


I've been mucking around with Perl of late, and
I find that Speakup and the Term::ReadLine::Perl module don't play nicely
together.  Every time I backspace over my input, the prompt is spoken
after each press of backspace.  Here's a little program, cribbed from the
Term::ReadLine documentation:

use Term::ReadLine;
my $term = new Term::ReadLine 'Simple Perl calc';
my $prompt = "Enter your arithmetic expression: ";
my $OUT = $term->OUT || \*STDOUT;
while ( defined ($_ = $term->readline($prompt)) ) {
my $res = eval($_);
warn $@ if $@;
print $OUT $res, "\n" unless $@;
$term->addhistory($_) if /\S/;
}

Run this with Term::ReadLine::Perl installed, and type an expression
such as 2+2.  Try backspacing, and you'll hear the prompt repeated.

I'm certain that I know the cause of the problem.  The Perl module forcibly
redisplays the prompt after each press of the backspace key, and each
redisplay is faithfully rendered by Speakup.

What's the best way to fix or cope with this issue?

-- Chris



More information about the Speakup mailing list