Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Can't use up/down arrow for history in cpan shell

by Myrddin Wyllt (Hermit)
on May 20, 2016 at 21:43 UTC ( [id://1163692]=note: print w/replies, xml ) Need Help??


in reply to Can't use up/down arrow for history in cpan shell

I think just installing Term::ReadKey and Term::ReadLine::Perl will do the trick. I have some notes scribbled in a margin somewhere that I use on any fresh install, and those are the only two modules mentioned, so I presume they give you all you need (otherwise I would have scribbled more).

The other things I scribbled were:-

  • install CPAN, reload CPAN (so the cpan client is up to date)
  • o conf prerequisites_policy 'follow'
  • o conf build_requires_install_policy yes
  • o conf commit

Which saves a lot of sitting round typing 'y' in a Homer Simpson-like fashion. These aren't the defaults for very good reasons (which I've forgotten), but so far I haven't had any problems using them

Replies are listed 'Best First'.
Re^2: Can't use up/down arrow for history in cpan shell
by stevieb (Canon) on May 20, 2016 at 22:12 UTC

    The OPs problem is that the up and down arrow history doesn't work with the default Term::ReadLine::Perl, which is why one needs to install Term::ReadLine::Gnu for cpan (and the debugger) to get up-arrow history access.

    I'm not currently in a position to test this, but I will.

      The OP doesn't actually mention Term::ReadLine::Perl, which isn't in the core so isn't really a 'default' (I know some chap on StackOverflow said it was, but corelist disagrees). I was just saying that T::R::P, together with Term::ReadKey works fine (at least on Linux, I haven't tested on any other OS).

      T::R::Gnu may well be a better solution - I was just giving another view from my personal experience of what I did to get this working. I know this works on Slackware, Debian and CentOS, and has done for many years, but I will definitely try Term::ReadLine::Gnu next time, and have already updated my scribblings to that effect.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1163692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-25 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found