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

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.

  • Comment on Re^3: Simulating Command Line History in Perl

Replies are listed 'Best First'.
Re^4: Simulating Command Line History in Perl
by almut (Canon) on Apr 24, 2010 at 07:28 UTC
    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.