in reply to Re^2: what should be in PERL5LIB after installing from source the 5.40.1 version on MacOS (am64)
in thread what should be in PERL5LIB after installing from source the 5.40.1 version on MacOS (am64)

The paths displayed then became part of my PERL5LIB, for each version.

But why? These are the paths Perl already knows about, there's no need to list them in PERL5LIB!

If your cpanm programs have been installed properly, then each of them should be able to install into suitable locations without specifing any -L directory at all. If you run:

cpanm --version

...then each cpanm will tell you which version of Perl it is running, where it is about to install, and where it is looking for libraries (should be mostly the same as where it is about to install, with exception of cpanm's own FatPacked stuff). These should be different for each cpanm, and different from where your MacPorts Perl is installing.

  • Comment on Re^3: what should be in PERL5LIB after installing from source the 5.40.1 version on MacOS (am64)
  • Download Code

Replies are listed 'Best First'.
Re^4: what should be in PERL5LIB after installing from source the 5.40.1 version on MacOS (am64)
by kwolcott (Acolyte) on Feb 23, 2025 at 00:46 UTC

    Thanks again for clarification. That means that I confused cpanm on the intial installation of cpanm and it is perpetually confused. So I don't even need a PERL5LIB at all? I don't create or bundle my modules; everything comes with Perl or comes from CPAN, so it should know where to go...AWESOME!

    I use cpanm over cpan to install Perl modules, so my install install of cpanm via cpan must be correct, then I'll be on the correct path going forwards.

    Thanks, I'll work on that.

      So I don't even need a PERL5LIB at all?

      Correct.

      PERL_MM_OPT and PERL_MB_OPT should be unset. That way, modules will be installed in the default directory for the perl being used.

      And since you're installing modules in the default directory for the perl being used, you don't need to tell Perl where to look, so PERL5LIB should also be unset.

      Finally, make sure you used the correct perl (e.g. by using the cpan installed by it) when installing modules.

      If you have any further questions, please provide the output of perl -V:'inst.*' (capital "V") so I can provide concrete examples.