Search code examples
perlcygwincpan

cygwin perl cpan installations in wrong directory


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

Solution

  • 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"