in reply to Re: How to add input history
in thread How to add input history

Your code doesn't seem to do anything when I use the up-arrow...

steve@spek ~ $ ./test.pl Input the dice and modifier you want to roll like this: 2d9+100 +. To quit, press Ctrl-C. ? 2d9+100 104 105 ? ^[[A ?

-stevieb

Replies are listed 'Best First'.
Re^3: How to add input history
by Anonymous Monk on Apr 06, 2015 at 22:09 UTC

    See the perldoc page DESCRIPTION for Term::ReadLine . You will need one of the Term::ReadLine::* packages.

    I have Term::ReadLine::Perl

    That's probably why it worked for me.

      That very well could be, but if I don't have a module installed, I would expect an error message.

      If I, someone who has used Perl since ~2001, doesn't get an error message from a missing package when I'm testing for valid output, how could one expect OP or a new user to know what to expect from code without any knowledge?

      Perhaps something in the upstream package should be told to say something. I'm not bitching, I'm just stating a point. There's something missing here :)

      -stevieb

      ps. I copied and pasted your exact code.

      pps. I suppose what I'm saying here is that if you are going to respond to a thread to help someone, either ensure the module you recommend errors out if dependencies aren't found, or put a clause in your post that says "may not work if X, Y, or Z isn't installed". Think about it... if you were a new user, would you immediately think to look up the perldoc info for a module if all you were looking for was code and you didn't see a responsible piece about "read perldoc for X module"?

        Yet another case of "No good deed goes unpunished."