in reply to How to handle modules across different versions

Hi ksublondie,

It's possible to have a single common.pm and then inside it test for different versions of Perl, e.g. with $^V or $]. If you need to load different modules in different versions of Perl it can get a little more tricky, but see this thread for some potential solutions: The "right" way to make your script run with old versions of perl

What are the actual differences you've got in common.pm across your different versions?

Regards,
-- Hauke D

  • Comment on Re: How to handle modules across different versions

Replies are listed 'Best First'.
Re^2: How to handle modules across different versions
by ksublondie (Friar) on Jul 20, 2016 at 15:13 UTC
    Right now, there aren't any differences because we've just been lucky enough to not experience any changes in the versions we've implemented in the current common.pm files. However, if I were to go back and implement them for the older versions, there would definitely be differences in the modules used and even the implementation of the same modules.

    Example: I use Date::Manip for almost all of my date handling, but the module for perl < 5.10 is significantly different than perl >= 5.10.

    Loading completely different modules in one version over another is definitely a scenario I will run across as well.

    I'll check out the post you provided. Thanks.

      Hi ksublondie,

      Is there something preventing you from upgrading the modules to the latest version (or, at least, some common version that compiles everywhere) on all machines?

      Anyway, if you do end up having to use different modules/versions, one of the solutions in the thread I linked to earlier should be applicable to your situation.

      Regards,
      -- Hauke D

        What they said.

        Upgrade as fast as possible to as current as possible. I convinced folks at my $job to upgrade Perl, but we've been so slow at it (priorities I don't control) that the one we're still planning on upgrading to is already out of date (not Perl's fault, it's on us). (The next version up for us breaks too much existing old code base.)

        I don't know Windows well, but is there something like Brew to help with managing different versions of Perl on the same box? Or skip Brew and just be precise in the shebang.