How to install cpan module on specific Perl installation and on system default Perl ?

This is my first question here

Currently I am working on Ubuntu flavor of linux OS. I have default 5.26.1 version of Perl pre-installed. Output of perl -v command copy pasted below

This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi

I have installed perl-5.8.9 using perlbrew and installed CPAN client cpanm. Now I am trying to install File::Find::Rule module then I am getting output mentioned below. Here I am not getting where this module got installed and how I can control module installation must be done in specific Perl installation

! ! Can't write to /usr/local/share/perl/5.26.1 and /usr/local/bin: Inst +alling modules to /home/kshitij/perl5 ! To turn off this warning, you have to do one of the following: ! - run me as a root or with --sudo option (to install to /usr/local +/share/perl/5.26.1 and /usr/local/bin) ! - Configure local::lib in your existing shell to set PERL_MM_OPT e +tc. ! - Install local::lib by running the following commands ! ! cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/per +l5/lib/perl5/ -Mlocal::lib) ! --> Working on File::Find::Rule Fetching http://www.cpan.org/authors/id/R/RC/RCLAMP/File-Find-Rule-0.3 +4.tar.gz ... OK Configuring File-Find-Rule-0.34 ... OK ==> Found dependencies: Number::Compare, Text::Glob --> Working on Number::Compare Fetching http://www.cpan.org/authors/id/R/RC/RCLAMP/Number-Compare-0.0 +3.tar.gz ... OK Configuring Number-Compare-0.03 ... OK Building and testing Number-Compare-0.03 ... OK Successfully installed Number-Compare-0.03 --> Working on Text::Glob Fetching http://www.cpan.org/authors/id/R/RC/RCLAMP/Text-Glob-0.11.tar +.gz ... OK Configuring Text-Glob-0.11 ... OK Building and testing Text-Glob-0.11 ... OK Successfully installed Text-Glob-0.11 Building and testing File-Find-Rule-0.34 ... OK Successfully installed File-Find-Rule-0.34 3 distributions installed

I have also tried switching Perl using perlbrew. Note : when I hit command perlbrew list it only lists perl-5.8.9


In reply to Struggling in installaion of any module in Perl which is installed using perlbrew by phoenix007

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.