in reply to Re: Simulating Command Line History in Perl
in thread Simulating Command Line History in Perl

Like I said, I understand that ReadLine can get the history...that's the easy part. What methods on, say, Term::ReadLine::Gnu, will put the output back on the screen for the user to edit?
  • Comment on Re^2: Simulating Command Line History in Perl

Replies are listed 'Best First'.
Re^3: Simulating Command Line History in Perl
by Only1KW (Sexton) on Apr 23, 2010 at 21:40 UTC
    Nm, I see about the second argument now. It seems to be working now. Thanks.

    Just wish the ReadLine help text were more verbose about this.

      I see about the second argument now

      Just to be clear, the second argument is not for implementing a command history; it's for prompting with some default input as, for example, in install/configure scripts

      ... In which directory would you like the package to be installed? > /usr/local/foo

      where the editable input "/usr/local/foo" would appear at the prompt immediately, as a suggested default choice, without the user having to hit any cursor up/down keys etc.  Implementing a history via that feature would be quite cumbersome, as you'd have to read out the respective history entries yourself and present a new prompt for each entry...

      With GNU readline the history is basic functionality, which should work without further ado, if you have the right backend module installed.