how to handle "up movement key" in perl
hi folks,
I have this perl script which reads the user inputs,
"
....
while(<STDIN>) {
...
[at] inputs = split(" ", $_);
if (scalar( [at] inputs) == 1 ) {
if ($_ =~ /\?/) { &help; }
elsif (/ /)
{ &print_previous_input } ### <==what should I
put between "/ /"
...
}
}
"
where you can see, during the "elsif" line , when user clicks the "up
movement key" on keyboard, I want to print out the input that he
previously entered, but I don't know how what should I put in the
" / / " area.
Any clues for that. I am using linux machines, with PERL 5.8.8.
Chun
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: how to handle "up movement key" in perl
ä=BA=8E 2011-3-15 15:42, John =E5=86=99=E9=81=93:
> where you can see, during the "elsif" line , when user clicks the "up
> movement key" on keyboard, I want to print out the input that he
> previously entered, but I don't know how what should I put in the
> " / / " area.
Just my guess, you may want the Term::ReadLine module on CPAN for the cas=
e.
terry.
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: how to handle "up movement key" in perl
On 11-03-15 03:42 AM, John wrote:
> where you can see, during the "elsif" line , when user clicks the "up
> movement key" on keyboard, I want to print out the input that he
> previously entered, but I don't know how what should I put in the
> " / / " area.
I think Term::ReadKey will do what you want.
See: http://search.cpan.org/~kjalb/TermReadKey-2.14/ReadKey.pm
--
Just my 0.00000002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization and communication
as it is about coding.
The secret to great software: Fail early & often.
Eliminate software piracy: use only FLOSS.
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/