in reply to Re^3: Avoid newline echoing so I can capture a line and reprompt over it
in thread Avoid newline echoing so I can capture a line and reprompt over it
But I think the call to readline is the only important onesub 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; }
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>; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Avoid newline echoing so I can capture a line and reprompt over it
by japhy (Canon) on Sep 02, 2004 at 13:26 UTC | |
by hlen (Beadle) on Sep 02, 2004 at 14:47 UTC | |
|
Re^5: Avoid newline echoing so I can capture a line and reprompt over it
by japhy (Canon) on Sep 02, 2004 at 13:18 UTC |