clerew has asked for the wisdom of the Perl Monks concerning the following question:
Ubuntu 14.04, with Perl installed in /usr (and one doesn't tinker with /usr)
/usr/local/CPAN/ for builds, etc
/usr/local/lib/perl/5.18.2 for downloaded modules; this is earlier in @INC than official /usr stuff, so stuff here should supersede stuff there.
List::Util (as supplied in /usr) is version 1.27
I want to download DateTime, which Requires version higher than 1.27.
Methinks "I will install later version (1.42) in /usr/local/..., where it will be seen before the older one".
But install List::Util says "but it's already installed"
Making the version in /usr invisible breaks cpan.pm, which itself makes use of List::Util
Eventually, after test List::Util followed by manual Makefile install, I land up with the following:
In /usr/local/lib/perl/5.18.2:
where Util.pm is the full compiled binaryi686-linux-gnu-thread-multi-64int List Util.pm Util XS.pm
But, since /usr/local/lib/perl/5.18.2 does not contain any List directory, installing DateTime fails because it still sees the old List::Util
So I grabbed /usr/lib/perl/5.18/List/Util.pm (the one I originally tried to make "invisible") and hacked it to look like
and inserted it into /usr/local/lib/perl/5.18.2 givingour @ISA = qw(Exporter); our @EXPORT_OK = qw(first min max minstr maxstr reduce sum sum0 shuff +le); our $VERSION = "1.42"; our $XS_VERSION = $VERSION; $VERSION = eval $VERSION; require XSLoader; XSLoader::load('List::Util', $XS_VERSION);
List Util.pm ---(as hacked) Util XS.pm ---(copied from the i686-linux... one) i686-linux-gnu-thread-multi-64int List Util.pm ---(the new binary) Util XS.pm
But this still picked up the old 1.27 binary, and I got the ridiculous situation
cpan[1]> m List::Util CPAN: Storable loaded ok (v2.41) Reading '/usr/local/CPAN/Metadata' Database was generated on Tue, 16 Jun 2015 21:53:20 GMT Module id = List::Util CPAN_USERID PEVANS (Paul Evans leonerd@leonerd.org.uk>) CPAN_VERSION 1.42 CPAN_FILE P/PE/PEVANS/Scalar-List-Utils-1.42.tar.gz UPLOAD_DATE 2015-04-23 INST_FILE /usr/lib/perl/5.18/List/Util.pm INST_VERSION 1.27
Incidentally, I tried to revert to the old situation by renaming the new List as Lost, but it still gives the same result to m List::Util so there must be some secret cache somewhere which remembers that state, even after a logout/reboot).
And further incidentally, that /usr/local/CPAN/Metadata file is 28MB long, and contains unreadable garbage; do I really need to keep it around?
What incantations do I have to give to make my List/Util.pm connect to the newly downloaded binary XS version?
And thank you for your patience in reading this far.
|
---|