develooper Front page | perl.beginners | Postings from August 2009

better readline?

Thread Next
Bryan R Harris
August 3, 2009 15:43
better readline?
Message ID:

I'm writing a little script where the user enters some data via keyboard.

The script in some cases can guess what the user will want to enter, but I'd
like the user to be able to override what the computer has guessed.

For example, the computer thinks the user will enter "8/2 Updated database",
but the user may want to enter "8/2 Removed links table".

Is there a way to have perl prompt the user thusly:

  Enter a date and note:  8/2 Updated database<cursor goes here>

... but then the user could backspace all the way back to 8/2 and change it
if they want?  Almost like I'm pushing something into <STDIN>, which will
then get read back out?

I'm not even sure what words to use to ask, but I hope that's clear enough??


- Bryan

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About