I’ve been using XML::Twig to parse some massive amounts of XML text for a project at work. My script worked just fine on my Fedora 20 workstation, but threw a segfault when run on the target Red Hat Enterprise 6 server.
Turns out there’s a bug in versions of perl earlier that 5.15 that leads to the result I saw. The technical details are described under BUGS in the perldoc for the module.
The solution for now is for me to do an additional installation of perl using the latest version (5.18.x) on my server. Back in my Solaris 7/8 days I used to use either sunfreeware (which ironically is no longer free, mostly due to Oracle’s failure to continue the generous support that Sun once provided) or just compile from source.
On Linux I’ve also got a few choices. The easiest, installing ActiveState’s ActivePerl isn’t an option because this is a production server process and their license prohibits using the free Community Edition in production (I did try this out on a test system, and the script performed perfectly under the latest AS perl for Linux). There’s also Perlbrew, which installs a utility that’s supposed to facilitate installing and running multiple versions of perl in a user’s home directory. Unfortunately this didn’t install for me, although I tried both the installer-via-curl and cpan methods. My final choice was to download and compile from source, which is how I’m now proceeding (fortunately my production machines are almost identical at the binary level, so I’ll be able to reuse what I build on other systems).