Recently, we upgraded our systems, and one of the updates was an update to Perl. After this update, a portion of Bugzilla failed to work as expected; the problem turned out to be in SOAP::Lite:
# perl -MSOAP::Lite -e "print;" weaken is only available with the XS version of Scalar::Util at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 2502 BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 2502. Compilation failed in require. BEGIN failed--compilation aborted.
This is on a machine running Red Hat Enterprise Linux (RHEL) 5.7. The bug (Bug #375621) was initially reported back in November 2007 with RHEL 5.2. The final resolution came with bug #594768, where the problem was explained completely and resolved for good in RHEL 6.
The problem is that the updates to Perl are overwriting files added via CPAN. When this happens, versions that have an XS version are reverted back to their original forms without XS support. This appears to happen with Scalar::Util the most.
The fix is to reinstall the CPAN modules affected by the Perl upgrade. A force will be necessary. For example, this command to install Scalar::Util:
cpan> force install Scalar::Util Running install for module Scalar::Util Running make for G/GB/GBARR/Scalar-List-Utils-1.23.tar.gz Fetching with LWP: ftp://cpan.uchicago.edu/pub/CPAN/authors/id/G/GB/GBARR/Scalar-List-Utils-1.23.tar.gz CPAN: Digest::MD5 loaded ok Fetching with LWP: ftp://cpan.uchicago.edu/pub/CPAN/authors/id/G/GB/GBARR/CHECKSUMS Checksum for /root/.cpan/sources/authors/id/G/GB/GBARR/Scalar-List-Utils-1.23.tar.gz ok Scanning cache /root/.cpan/build for sizes Scalar-List-Utils-1.23/ Scalar-List-Utils-1.23/Changes Scalar-List-Utils-1.23/lib/ Scalar-List-Utils-1.23/ListUtil.xs Scalar-List-Utils-1.23/Makefile.PL
Once the relevant modules are reinstalled, the files will be reverted back to the way they were before the upgrade took place – and all should be working again.
2 thoughts on “HowTo Fix: “[…] only available with the XS version of Scalar::Util””
Thanks, solved an issue with Munin on a CentOS 5.9 with the EPEL repository enabled.
Problem is that after today’s update of Munin the trick doesn’t work anymore … gives me an error on the CPAN console 😦