|Keep It Simple, Stupid|
SOLVED: How to install Term::ReadLine::Gnu in perlbrew ... only once?by haj (Chaplain)
|on Nov 06, 2019 at 18:10 UTC||Need Help??|
haj has asked for the wisdom of the Perl Monks concerning the following question:
Edited to add: The rest of this article is now mostly interesting if someone happens to stumble over the same symptoms, since the solution was indeed a messed-up setup of my system. It turned out that I had an activation of local::lib in my .bashrc, probably copied from an outdated backup of the previous desktop. After deleting the line eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)" from .bashrc everything works as it should. There is no problem with having XS libraries for multiple versions of Perl with perlbrew. Binaries from different verions of XS components end up in different directories, and if they are wrappers for system libraries like libreadline, then all of them resolve quite fine against same the system library.Hi fellow monks,
One of the routine modules I'm installing in Perl is Term::ReadLine::Gnu, because without it I can't use arrow-up to browse through the history in the Perl debugger. I am on Debian Buster and I have libterm-readline-gnu-perl installed. Fine so far.
But I'm also using perlbrew, so I want to have the same module in my perlbrew environments. I have cpamn set up so it installs everything under ~/perl5, which works quite well, with the notable exception of Term::ReadLine::Gnu.
I couldn't just cpanm Term::ReadLine::Gnu because I need to have the readline headers. This did not surprise me too much since that happens with all Perl modules which are just wrappers around some system libs. So, I installed the Debian package libreadline-dev, and voila, cpanm Term::ReadLine::Gnu installs quite fine and works.
However, as soon as I switch the perl version (in that case from 5.30.0 to 5.22.1) to and enter the debugger, I get:
However, under the 5.22.1, I can also install cpanm Term::ReadLine::Gnu, and from that time on, it works. Until I switch back to 5.30.1, where I get the same error.
Is there a way around this? I'd rather not re-install Term::ReadLine::Gnu every time I switch the Perl version...