0

I have a cygwin perl setup and i do a cpan App::cpanminus or cpan ExtUtils::Config i get a response that the packages are installed successfully,

but cpanm is not in path its on ~/Perl5/bin and i dont know where ExtUtils::Config is installed if i do a perl -e 'use ExtUtils::Config;' i get an error that it is not found

I feel this is a cpan configuration error but dont know what it is or how to fix it, can some one help me in this regard?

Edit:

Output of echo 'o conf' | cpan | perl -ne'print if /^\s*(make|mbuild)(pl)?_/'

make_arg           []
make_install_arg   []
make_install_make_command [/usr/bin/make]
makepl_arg         []
mbuild_arg         []
mbuild_install_arg []
mbuild_install_build_command [./Build]
mbuildpl_arg       []

and output of perl -le'print "$_=$ENV{$_}" for grep /^PERL/, keys %ENV'

PERL_MB_OPT=--install_base "/home/<user>/perl5"
PERL_MM_OPT=INSTALL_BASE=/home/<user>/perl5
tejas
  • 1,795
  • 1
  • 16
  • 34
  • Are the environment variables `PERL_MB_OPT` and `PERL_MM_OPT` set? – ThisSuitIsBlackNot May 26 '16 at 18:31
  • 1
    Please add the output of `echo 'o conf' | cpan | perl -ne'print if /^\s*(make|mbuild)(pl)?_/'` and the output of `perl -le'print "$_=$ENV{$_}" for grep /^PERL/, keys %ENV'` to your question. – ikegami May 26 '16 at 18:49
  • 1
    You *might* have configured cpan to [bootstrap local::lib](http://stackoverflow.com/q/32726324/176646), although in that case I would also expect to see the `PERL_LOCAL_LIB_ROOT` variable set. – ThisSuitIsBlackNot May 26 '16 at 19:24
  • there is no `PERL_LOCAL_LIB_ROOT` in `.bashrc` and I ran `o conf init` and it didnt prompt me anything about `local::lib`. maybe i could add that manually in `.bashrc` and also update `PATH` variable to include `~/perl5/bin`. – tejas May 26 '16 at 19:50
  • (Use @username in replies to other people so they get notified. It's a fluke that I noticed you provided the requested information.) – ikegami May 27 '16 at 06:26

1 Answers1

1

The following tell the module installers (ExtUtils::MakeMaker and Module::Build respectively) to install the modules in directory other than the one perl looks in:

PERL_MM_OPT=INSTALL_BASE=/home/<user>/perl5
PERL_MB_OPT=--install_base "/home/<user>/perl5"

Either unset these variables (to install the modules in their "proper" place), or tell perl to look for modules in that directory.

export PERL5LIB="$HOME/perl5/lib/perl5"
ikegami
  • 367,544
  • 15
  • 269
  • 518
  • also @ThisSuitIsBlackNot 's question helped, i added these three manually to .bashrc export PATH="$PATH:/home//perl5/bin" PERL_LOCAL_LIB_ROOT="/home//perl5"; export PERL_LOCAL_LIB_ROOT; PERL5LIB="/home//perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB; – tejas May 28 '16 at 06:59