2019-01-16 List::Util

This is annoying: can’t upgrade the thing that needs upgrading. Now what do I do?

alex@melanobombus:~/src/halberds-and-helmets$ cpanm List::Util
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xde00080, needed 0xce00080)

Right now, I’m confused by my own Perl setup. In my `~/.bashrc` I seem to be set up for `perlbrew` – but I only use it on the Mac and on the server, not on this laptop. I guess at one point using `perlbrew` was planned but then never acted upon.

# Perl 5: use perlbrew
source ~/perl5/perlbrew/etc/bashrc
PATH="/home/alex/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/alex/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/alex/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/alex/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/alex/perl5"; export PERL_MM_OPT;

When I try and list the versions I have, I’ve got nothing:

alex@melanobombus:~$ perlbrew list

No reply. But I think this is unrelated. Back to the `~/perl5` directory which probably contains modules that no longer work with the current version of Perl, which is a problem if the tool used to update the modules requires them. In theory, I guess this shouldn’t happen because `List::Util` is a core module and thus I shouldn’t be installing it anyway. But I did. 🤷

I guess I should do away with my `~/perl5` directory if I don’t use `perlbrew` and try and use the Perl packages provided by my package manager? I bet this isn’t going to end well.

Let’s try a manual uninstall, first:

alex@melanobombus:~$ find perl5 -name List
perl5/lib/perl5/x86_64-linux-gnu-thread-multi/List
perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/List
alex@melanobombus:~$ ls perl5/lib/perl5/x86_64-linux-gnu-thread-multi/List
Util  Util.pm
alex@melanobombus:~$ ls perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/List
Util
alex@melanobombus:~$ rm -rf perl5/lib/perl5/x86_64-linux-gnu-thread-multi/List perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/List

That seems to have done the trick.

​#Perl