February 09, 2021

Perl binaries are mismatched - the revenge of the lazy person

The uninvited eldrich terror

You use local::lib, and the pain unfolds: A shell is started, and you find a dreaded:

Cwd.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xdb80080)

Pennywise, because I could not find the right gif, from the Uninvited, of Sabrina's netflix

Which means: that the module (Cwd in this case) is not compatible (Because it’s an XS module) with your current version of perl, installed on your system: Likely it was compiled for a previous version, leadin to those binaries mismatching

Don’t panic!

I wrote about this however, I left out how to get to the point where you have already an usable Perl again?

The light

Instead of downloading local::lib from git as I used to do… this time I decided to do it on a much simpler way: use perl-local-lib from my distribution, and let it do the magic, I mean that’s why I run openSUSE Tumbleweed

 $ rm -rf perl5-old || echo "First time eh?"
 $ mv perl5 perl5-old
 $ perl-migrate-modules --from ~/perl5-old/lib/perl5 /usr/bin/perl
 $ perl -MCPAN -Mlocal::lib -e 'CPAN::install(App::cpanminus)'
 $ cpanm App::MigrateModules
 $ perl-migrate-modules --from ~/perl5-old/lib/perl5 /usr/bin/perl

Et voilà, ma chérie!

It's alive!