Only1KW has asked for the wisdom of the Perl Monks concerning the following question:

Currently, my organization is considering upgrading from our previous versions of Perl 5, 5.6 and 5.8, to Perl 5.14 (and of course, upgrading all used modules also). Are there any gotchas in upgrading that far ahead in terms of potentially breaking pre-existing scripts? A Google search came up empty.

Note: Nowhere in this post did I mention Perl 6 (with this exception, of course). Your assistance in continuing that tradition in this thread is requested. Thank you.

Replies are listed 'Best First'.
Re: Major differences in Perl 5 versions
by davido (Cardinal) on Jul 14, 2011 at 20:29 UTC

    As you browse over the perl delta documents that ikegami posted you will see occasional mention (v5.8.0 for example) of Binary Incompatibility. From the v5.8.0 delta POD:

    Perl 5.8 is not binary compatible with earlier releases of Perl.

    You have to recompile your XS modules.

    (Pure Perl modules should continue to work.)

    There is a nice blog post by our fellow monk, chromatic: Perl 5 Version Numbers and Binary Compatibility. It provides more detail, and discusses that it is a goal of P5P to maintain binary compatibility between release families. So 5.8.0 should be binary compatible with 5.8.9, but there is no guarantee either way (aside from what may be documented in the perl delta docs) between 5.8.9 and 5.10.0. When in doubt, consult the POD. And when still in doubt, run the distribution tests of whatever modules you are concerned about (those using XS, for example).

    When you install a new version of Perl through any of the standard means, the core modules are automatically updated, so you won't have to consider them. But you may need to reinstall the non-core modules that use XS.

    If you have concerns you may want to use perlbrew to create a separate installation of the target upgrade version of Perl, and then test your code against it before committing yourself 100%. For that matter, there's really very little reason to ever deal with the system Perl. May as well just install a new perlbrew Perl, and once your test suites have all passed, select that one as the live Perl installation.


    Dave

Re: Major differences in Perl 5 versions
by ikegami (Patriarch) on Jul 14, 2011 at 20:06 UTC

    The Perl delta doc/man pages list incompatible changes. (Ignore deltas for 5.odd versions.)

    I suspect you'll get the most differences from changes in the modules.

Re: Major differences in Perl 5 versions
by Marshall (Canon) on Jul 14, 2011 at 20:19 UTC
    There is certainly always the potential for trouble when upgrading. As you point out lots of modules will typically be upgraded in the process too.

    The last time I made a major change, I went from Perl 5.6 to Perl 5.10 (I skipped 5.8). And yes some stuff "broke". As I remember, some of this had to do with deprecated syntax of some code. It would work, but there would be warnings. So I had to make modifications to get things running "clean". In a few cases I had trouble installing a more up to date module and had to do some futzing around.

    I'm an ActiveState user and I waited awhile after 5.10 became available so that I could get all the modules that I needed. If you are on Unix, that may not be an issue for you. My next adventure will probably be to just 5.12 as Active State isn't fully on-board with 5.14 yet.

    You didn't mention if you were also upgrading from 32 to 64 bit. I don't know the pitfalls in that. But if you are doing that, its probably worth a separate question.

    Overall the impact of upgrading was well worth it. The performance of some things that I care greatly about, like sort is vastly better in Perl 5.10 vs 5.6. And I've found that backward compatibility is very good.