views:

56

answers:

1

I have a utility that I use as a pseudo "shell". It basically while()'s stdin for commands and runs them through different subroutines.

My question is, is there a module or some example I can use to work toward trapping the up arrow so that I can have it perform a certain action? I plan to incorporate a previous command function similar to bash.

Right now, if I press the up arrow I get this:

patrick@utility$ ^[[A^[[A^[[A^[[A

Thanks in advance.

+6  A: 

Try Term::ReadLine module

Ivan Nevostruev