brillig has asked for the wisdom of the Perl Monks concerning the following question:

I have a program which makes a change to a string, and then prompts the user to ask them if that change was correct. If it was not correct, they should be able to edit the string.

The problem is that while I can get the user's input from STDIN, I'd like the program to display the modified string and let the user use keys like BACKSPACE and the LEFT and RIGHT arrows to move about it in, and then change it, (a one-line text editor).

I suspect there's some technique or module that already does this. Can anyone point me in the right direction?
(PS: I hope this didn't get submitted twice. If so, sorry!)

Replies are listed 'Best First'.
Re: output string editing
by ides (Deacon) on Jun 28, 2002 at 21:55 UTC
    I would suggest looking at Term::Readline::Gnu or some ncurses implementation if you're working from a commandline.

    -----------------------------------
    Frank Wiles <frank@wiles.org>
    http://frank.wiles.org

Re: output string editing
by chromatic (Archbishop) on Jun 28, 2002 at 21:34 UTC