We have a RHEL 5 box running some POE components that require the XS version of Scalar::Util. However, the yum repos appear to have the non-XS version included, so every upgrade of perl breaks the Perl code that requires Scalar::Util.
The fix is here:
http://www.cybersprocket.com/2011/programming-languages/weaken-is-only-available-with-the-xs-version-of-scalarutil/
cpan
> force install Scalar::Util
But why is this? If you check out the “Diagnostics” section for Scalar::Util at CPAN, you’ll see:
NAME is only available with the XS version of Scalar::Util
Scalar::Util contains both perl and C implementations of many of its functions so that those without access to a C compiler may still use it. However some of the functions are only available when a C compiler was available to compile the XS version of the extension
Meaning – the update from yum must install the perl-only impelementation for cross-compatibility. What’s of most interest here is that “force install Scalar::Util” isn’t actually the full answer – you have to have gcc installed as well, so that there’s a C-compiler available during the CPAN forced reinstall. In case your production systems don’t have gcc installed already.
Leave a Reply