|Problems? Is your data what you think it is?|
Architecture-specific module conflicts under perlbrewby gnosti (Friar)
|on May 16, 2013 at 02:13 UTC||Need Help??|
gnosti has asked for the
wisdom of the Perl Monks concerning the following question:
I'm in search of wisdom regarding perlbrew, specifically about controlling where perlbrew installs architecture-specific (i.e. compiled) modules.
I have installed perlbrew in standard fashion, used it to install a few versions of perl, and then installed some modules. But my architecture-specific files are going to a common tree, leading to this type of error:
Where did JSON::XS get installed?
A shared directory! And where is my current perl looking for modules?
Does my environment have anything to do with this?
Did I do that?
It appears I have two problems:
1. Under perlbrew, CPAN clients install architecture-specific files in a common tree, i.e.
even though these compiled files are most certainly incompatible across perl versions.
2. Under perlbrew, perl looks for architecture-specific files in a common tree, even though there are appropriate directories specific to each version of perl, i.e. one of
My questions are then, how to to set the preferences for a CPAN client under perlbrew to install to the latter set of directories (whether arguments, environment settings or patches?)
And similarly, to remove the former architecture-specific-shared directories from the PERL5LIB environment variable.
I'm confused that with perlbrew being around so long and having such a good reputation, no else seems to have this fundamental complaint and no bug has been filed against perlbrew on this issue.
Well there is a question at stackoverflow How can Install multiple Perl versions without them tripping over each other's XS modules? although the only answer is brian d foy's "don't use perlbrew, give each perl binary a version, i.e. perl-5.16.3 and let them find their own installed modules".
And there is Kent NL's post, although I didn't find it helpful, as cpanm clients continued installed to the shared tree, even after installing cpanm for each perl version.
Thanks for your interest and support!
UPDATE: For reasons unclear, my PERL5LIB environment variable is no longer set, and perlbrew is now behaving properly. I think it's possible that one of the terminals I was working had retained environment settings from local::lib, even after I had cleaned out those settings from .bashrc.
UPDATE 2: I've filed a bug against perlbrew, suggesting a warning on detecting any non-null PERL5LIB setting.