http://www.perlmonks.org?node_id=1032690

HelenCr has asked for the wisdom of the Perl Monks concerning the following question:

Dear esteemed PerlMonks

I have installed Strawberry Perl 5.16.3 in a Windows 7 system, (which already had DWIM Perl 5.12 installed). I have installed the new Perl in a different top directory, changing the paths in the "PATH" environment variable. Everything seems ok and according to the books.

The problem is, when I run cpanp, it says:

WARNING: terminal is not fully functional - (press RETURN)

and when I try to install a module (which had been installed at the old Perl but is missing in the new Perl, for example: Carp), it returns immediately, reporting (wrongly) in the installation log that the module exists.
In other words, somehow cpanp is not recognizing the new installation, although I have changed the system PATH.

What to do?

Many TIA - Helen

Notes:

  1. When I go: perl -v it replies:
    This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x64-multi-thread
    so the new installation got hold;
  2. I entered: >cpan -fi BINGOS/CPANPLUS-0.9136.tar.gz
    and it went through the entire installation of cpanp, returned OK; - but it didn't help, same behavior as described above.

Update: solved. See Re^6 below.

Replies are listed 'Best First'.
Re: cpanplus not functioning right in a multiple-Perl installation setup?
by Corion (Patriarch) on May 08, 2013 at 22:49 UTC

    Are you sure that the cpan program you invoke is the cpan that corresponds to the correct perl interpreter?

    Either explicitly invoke it as C:\Programs (x86)\strawberry\perl\bin\cpanp.bat or invoke it as  perl -MCPANPLUS -eshell after having made sure that perl invokes the correct Perl interpreter.

    Why do you want to keep multiple versions of Perl on a machine if it gives you so much trouble to separate them? I recommend having only one Perl on the machine until you feel confident in administrating that one version.

      Thank you, Corion. I'll try that later and report back.

      Multiple Perl installation are completely normal, and the NET is full of articles and posts showing how to do it. I'm doing it "according to the books", and it looks OK. The problem, IMO, is with the cpanplus configuration.

      Why do you want to keep multiple versions of Perl on a machine?
      I need to keep the old installation since I have a project which is running fine, and I don't want to disturb it.

      Many thanks - Helen

        Multiple Perl installation are completely normal ...

        Sure it is, but most folks who manage multiple installations know how to troubleshoot, how to turn on verbosity/logging/debugging, how to view configurations...

Re: cpanplus not functioning right in a multiple-Perl installation setup?
by Khen1950fx (Canon) on May 08, 2013 at 22:56 UTC
    CPANPLUS is built on top of CPAN. The warning is telling you that, in order for the terminal to be fully functional, you need to install a few more modules. Try installing these:
    #!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install(qw( Term::ReadLine Term::ReadLine::Gnu Term::UI));
    Update: Corrected. Thanks to Corion for noticing my mistake.

      Actually, CPANPLUS is not really based on CPAN.

      The rest of the advice still is true, except that you only need one of Term::Readline::Perl or Term::Readline::Gnu.

        The rest of the advice still is true, except that you only need one of Term::Readline::Perl or Term::Readline::Gnu.

        Sorry corion, but it isn't true :) You only need Term::ReadLine which is core, the rest are all optional, you don't need them

      Khen1950fx: I ran your program. Here is the output:

      Database was generated on Wed, 08 May 2013 21:53:13 GMT Term::ReadLine is up to date (1.10). Running install for module 'Term::ReadLine::Gnu' Running make for H/HA/HAYASHI/Term-ReadLine-Gnu-1.20.tar.gz Fetching with LWP: http://cpan.strawberryperl.com/authors/id/H/HA/HAYASHI/Term-ReadLine-G +nu-1.20.tar.gz Fetching with LWP: http://cpan.strawberryperl.com/authors/id/H/HA/HAYA +SHI/CHECKSUMS Checksum for F:\...\SBPerl\cpan\sources\authors\id\H\HA\HAYASHI\Term-R +eadLine-Gnu-1.20.tar.gz ok CPAN.pm: Building H/HA/HAYASHI/Term-ReadLine-Gnu-1.20.tar.gz Could not find neither libtermcap.a, libncurses.a, or libcurses. Warning: No success on command[F:\...\SBPerl\perl\bin\perl.exe Makefil +e.PL] HAYASHI/Term-ReadLine-Gnu-1.20.tar.gz F:\...\SBPerl\perl\bin\perl.exe Makefile.PL -- NOT OK Stopping: 'install' failed for 'Term::ReadLine::Gnu'.

      What to do?

      Many TIA - Helen

      Update:
      I ran your program with Term::ReadLine::Perl instead of: Term::ReadLine::Gnu, and it responded with:

      Database was generated on Wed, 08 May 2013 21:53:13 GMT Term::ReadLine is up to date (1.10). Term::ReadLine::Perl is up to date (1.0303). Term::UI is up to date (0.34).

      So this looks ok.

      And now, when I run cpanp, it's not complaining that "terminal is not fully functional". Which is good.
      Correction: sorry, that problem is still there.

      But this was not the main, original problem. The main problem was, that CPANPLUS was not recognizing the new Perl installation, although I've changed the "PATH" in the right way.

      I'll try using cpanp again, and report back.

      Many thanks - Helen

        And now, when I run cpanp, it's not complaining that "terminal is not fully functional". Which is good. Correction: sorry, that problem is still there.

        Doesn't this give you pause?

        Because the steps of installing Term::ReadLine et al. were exactly to make the cpanp program shut up about not having readline functionality.

        I would, as I already recommended, make triply certain that the correct Perl is finding the correct CPANPLUS module and the correct CPANPLUS configurations and that no trace of the other Perl installation is found in:

        • The environment. See perlrun for the interesting parts.
        • Configuration files. Maybe use App::Ack or maybe use the Windows "Search in Files" facilities for offending files.

        As the setup of more than one Perl version seems to be problematic for you, maybe you want to reconsider the decision of trying to maintain two versions of Perl on the same machine?