jettero has asked for the wisdom of the Perl Monks concerning the following question:
How on earth do ya get up arrow and tab completion to work in Term::ReadLine?
There must be a way to do it since the example on the man page does the addhistory. There's a bunch of talk about ornaments and Features in the man pages too. Perhaps it takes a working knowledge of the C version of readline?
I don't think the Term::ReadLine stuff is supposed to be the end of the line. I read somewhere that they intended it to be a base object for other packages?
#!/looser/nib/perl use strict; use Term::ReadLine; &start_stupid_math_shell; sub start_stupid_math_shell { my $term = new Term::ReadLine 'Simple Perl calc'; my $prompt = "Enter your arithmetic expression: "; while ( defined ($_ = $term->readline($prompt)) ) { my $res = eval($_), "\n"; warn $@ if $@; print $res, "\n" unless $@; $term->addhistory($_) if /\S/; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ReadLine Tabn'Up?
by KM (Priest) on Aug 11, 2000 at 19:58 UTC | |
by ZZamboni (Curate) on Aug 12, 2000 at 02:42 UTC |