Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Problem with Term::Readline with ssh

by (Initiate)
on Apr 02, 2013 at 13:54 UTC ( #1026691=perlquestion: print w/ replies, xml ) Need Help?? has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use the example code from Term::Readline:
use Term::ReadLine; my $term = Term::ReadLine->new('Simple Perl calc'); my $prompt = "Enter your arithmetic expression: "; my $OUT = $term->OUT || \*STDOUT; while ( defined ($_ = $term->readline($prompt)) ) { my $res = eval($_); warn $@ if $@; print $OUT $res, "\n" unless $@; $term->addhistory($_) if /\S/; }
It works fine on local machine, but if I put the script on a remote server, then I log in the the server with ssh and execute the script, it does not recognize my up arrow anymore, it only show "^[[A" when I press up arrow. Could anyone give a hint how to fix/debug this? I'm using ubuntu 12.04.

Comment on Problem with Term::Readline with ssh
Download Code
Replies are listed 'Best First'.
Re: Problem with Term::Readline with ssh
by LanX (Chancellor) on Apr 02, 2013 at 14:01 UTC
    Just a guess:

    IIRC thats what the debugger shows if gnu's readline is not installed...


    Cheers Rolf

    ( addicted to the Perl Programming Language)


    yep, searching helps

    see Re: Previous commands in Ubuntu terminal

    and try sudo apt-get install libterm-readline-gnu-perl on your remote host.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1026691]
Approved by ww
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2015-11-28 11:38 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (741 votes), past polls