in reply to using cpanm with perlbrew

It seems that you have cpanm installed into your system perl, and not your perlbrew perl.

Do you have cpanm installed in your perlbrew perl, e.g. /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/cpanm?

If you don't find cpanm there, then I recommend you confirm that you are using your perlbrew perl:

bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl

Then install cpanm using the following (this is taken directly from the App::cpanminus instructions):

curl -L http://cpanmin.us | perl - App::cpanminus
Then, confirm that you are using the cpanm that was installed to your perlbrew perl:
bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/cpanm
Then install Moo using cpanm:
cpanm Moo
You may also need to install App::DuckPAN into your perlbrew perl:
cpanm App::DuckPAN
I hope this helps.

Replies are listed 'Best First'.
Re^2: using cpanm with perlbrew
by nbezzala (Scribe) on Jan 25, 2014 at 06:41 UTC
    Thanks kevbot, I tried it, but its still the same
    bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl bash-4.2$ curl -L http://cpanmin.us | perl - App::cpanminus % Total % Received % Xferd Average Speed Time Time Time + Current Dload Upload Total Spent Left + Speed 100 303 0 303 0 0 258 0 --:--:-- 0:00:01 --:--: +-- 1561 100 262k 100 262k 0 0 72406 0 0:00:03 0:00:03 --:--: +-- 215k --> Working on App::cpanminus Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1. +7001.tar.gz ... OK Configuring App-cpanminus-1.7001 ... OK Building and testing App-cpanminus-1.7001 ... OK Successfully installed App-cpanminus-1.7001 1 distribution installed bash-4.2$ which cpanm /home/nitishb/perl5/bin/cpanm bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl bash-4.2$ cpanm Moo Moo is up to date. (1.004002) bash-4.2$ cpanm App::DuckPAN App::DuckPAN is up to date. (0.135) bash-4.2$ duckpan DDGC::Static Can't locate Moo.pm in @INC (@INC contains: /home/nitishb/perl5/lib/pe +rl5/x86_64-linux /home/nitishb/perl5/lib/perl5 /home/nitishb/perl5/pe +rlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux /home/niti +shb/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3 /home/nitis +hb/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux /home/nit +ishb/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3 .) at /home/nitishb/ +perl5/lib/perl5/App/DuckPAN.pm line 11. BEGIN failed--compilation aborted at /home/nitishb/perl5/lib/perl5/App +/DuckPAN.pm line 11. Compilation failed in require at /usr/local/bin/duckpan line 16. BEGIN failed--compilation aborted at /usr/local/bin/duckpan line 16. bash-4.2$

      Maybe your $ENV{PATH} is messed up or you have aliased perl to /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl.

      You will need to debug your shell setup and find out why invoking Perl as perl does not seem to use the correct Perl. Personally, I prefer to use absolute paths instead to choose the correct Perl. Maybe try:

      curl -L http://cpanmin.us | /home/nitishb/perl5/perlbrew/perls/perl-5. +16.3/bin/perl - App::cpanminus

      Without seeing your environment, there is very little to be done otherwise.