Here is what the code I'm trying to work on does:
sub getlineUnix {
my $message;
eval {
local $SIG{ALRM} = sub {
$old = $readline::line;
die
};
alarm($config{timeout}) unless $^O =~ /win32/i;
$message = $term->readline("Talk: ", $old);
$old = $readline::line = '';
alarm(0) unless $^O =~ /win32/i;
};
$message;
}
But I think the call to readline is the only important one
in there. Here's what I think it comes down to in
Term::ReadLine:
sub get_line {
my $self = shift;
$self->Tk_loop if $Term::ReadLine::toloop && defined &Tk::DoOneEvent
+;
my $in = $self->IN;
local ($/) = "\n";
return scalar <$in>;
}