Knowledge Base:Software builds fail with perl module missing even though it is installed

Synopsis
When building software, it fails in the configure phase with a message similar to the following:

However, after checking it can be verified that that XML::Parser is installed on the system:

Environment
This error can come up on any system with Perl.

Analysis
Perl modules are built for a particular Perl target. When Perl upgrades to a higher version, these modules are not automatically rebuilt. As a result, Perl itself might be a higher version although the module is only available for a lower version:

In the above examples, Perl is at 5.16.3 whereas the XML::Parser module is for 5.12.4.

The solution is to rebuild the XML-Parser package, or even better, rebuild all Perl-depending modules.

Resolution
Use perl-cleaner to rebuild all Perl modules currently built for older Perl versions.

If perl-cleaner is not working
If perl-cleaner does not work, please file a bug. But as an interim solution, the following tools can help address this issue manually:

This will give a list of all Gentoo packages that are still installed for version, which need reinstalling.

You may want to install them by hand, or this command may do the trick:

If the local kernel version contains a user@host appendix
This could be misinterpreted by Perl in a file like (see above).

"$Config{'archname'}-$Config{'osvers'}" eq "x86_64-linux-thread-multi-3.17.3-gentoo_5.enihprom@balaenoptera.hyperprime.gaia" or  die "Errno architecture (x86_64-linux-thread-multi-3.17.3-gentoo_5.enihprom@balaenoptera.hyperprime.gaia) does not match executable architecture ($Config{'archname'}-$Config{'osvers'})";

Since Perl interprets -prefixed variables inside double quoted strings as array, changing these lines that contain   symbols to be preceded by   (backslashes) should help temporarily resolve the problem:

Unfortunately this specific file contains a comment saying:


 * 1) This file is auto-generated. ***ANY*** changes here will be lost

This bug should be fixed inside the escaping policy of Perls standard library build scripts and this section removed.