in reply to Why is lib/perl5 not added to INC for perls installed using perlbrew
G'day areldy_exten,
Welcome to the Monastery.
I also have Perl 5.32.0 installed using Perlbrew. From the description of your setup, mine seems to be identical; of course, mine may differ from yours in areas that you haven't mentioned.
$ perlbrew list * perl-5.32.0 perl-5.30.0 $ which perl /home/ken/perl5/perlbrew/perls/perl-5.32.0/bin/perl $ echo $PERLBREW_ROOT /home/ken/perl5/perlbrew $ $PERLBREW_ROOT/perls/perl-5.32.0/bin/perl -V Summary of my perl5 (revision 5 version 32 subversion 0) configuration +: ... @INC: /home/ken/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/cy +gwin-thread-multi /home/ken/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0 /home/ken/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/cygwin-threa +d-multi /home/ken/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0 $ ls -l $PERLBREW_ROOT/perls/perl-5.32.0/lib/perl5 ls: cannot access '/home/ken/perl5/perlbrew/perls/perl-5.32.0/lib/perl +5': No such file or directory
"Why isn't this included automatically in the @INC?"
Short answer: because it doesn't exist.
Longer answer. I've been using Perlbrew for a very long time, certainly more than a decade, and I don't recall $PERLBREW_ROOT/perls/<install-name>/lib/perl5 ever being a standard Perlbrew directory. This would be why such a path would not be automatically added to @INC.
I'm not a user of cpanm, I use cpan. As such, I'm not in any position to comment on your use of cpanm beyond suggesting that you check that you are using it correctly. I know cpanm is widely used: if you have questions about that, you can definitely get help about it here.
If you have modules installed in non-standard locations, consider using PERL5LIB (see "perlrun: ENVIRONMENT") or use the lib pragma. There are other ways of dealing with this but that's probably jumping the gun and heading off-topic for the current issue.
Minor in-joke for anyone who recalls "Re^4: [OT] 'perl' is not the 'perl' reported by 'which perl'": yes, I did remember type but thought which was more appropriate here. However, just for completeness:
$ type perl perl is /home/ken/perl5/perlbrew/perls/perl-5.32.0/bin/perl
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is lib/perl5 not added to INC for perls installed using perlbrew
by tobyink (Canon) on Sep 11, 2020 at 15:50 UTC | |
by areldy_exten (Novice) on Sep 12, 2020 at 13:09 UTC | |
by tobyink (Canon) on Sep 14, 2020 at 00:35 UTC | |
by areldy_exten (Novice) on Sep 14, 2020 at 07:19 UTC | |
by kcott (Archbishop) on Sep 14, 2020 at 06:11 UTC | |
by tobyink (Canon) on Sep 14, 2020 at 08:21 UTC | |
by afoken (Chancellor) on Sep 14, 2020 at 13:03 UTC |