I have Ubuntu installed under Windows Subsystem for Linux 2 (WSL2). There are Perl5 modules installed under /usr/share/perl/5.30.0 and I can access these with a plain use statement. But when I install new modules with cpanminus, it puts them in /home/*****/perl5/lib/perl5/, where the interpreter can't find them unless I have a use lib declaration at the top. Is there some way to get cpanm to install them in the right spot? Here is the relevant output of perl -V. IDK if the entries in %ENV were there before I used cpanm. Otherwise the installation is what came with the distro.
%ENV: + PERL5LIB="/home/*****/perl5/lib/perl5" + PERL_LOCAL_LIB_ROOT="/home/*****/perl5" + PERL_MB_OPT="--install_base "/home/*****/perl5"" + PERL_MM_OPT="INSTALL_BASE=/home/*****/perl5" + @INC: + /home/*****/perl5/lib/perl5/5.30.0/x86_64-linux-gnu-thread-multi + /home/*****/perl5/lib/perl5/5.30.0 + /home/*****/perl5/lib/perl5/x86_64-linux-gnu-thread-multi + /home/*****/perl5/lib/perl5 + /etc/perl + /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 + /usr/local/share/perl/5.30.0 + /usr/lib/x86_64-linux-gnu/perl5/5.30 + /usr/share/perl5 + /usr/lib/x86_64-linux-gnu/perl/5.30 + /usr/share/perl/5.30 + /usr/local/lib/site_perl + /usr/lib/x86_64-linux-gnu/perl-base

In reply to Why is cpanm installing Perl5 modules in the wrong spot? by cormanaz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.