in reply to Re: How to tell what version of Perl a script needs?
in thread How to tell what version of Perl a script needs?

This is exactly why I have this question, actually.

I'm working at a company where (IMO) the versions cannot be relied upon to be consistent or up to date (*) and the company wants to be able to copy scripts around from machine to machine. I've just finished writing a (fairly sizable) CGI for them and it suddenly occurred to me that, when they move it around, it might break if the provided perl is too low. I would like to be able to put in a 'use XYZ' line to at least document what version is required.

(*) There are reasons for this and they aren't all bad. But that's a whole 'nother discussion.

  • Comment on Re^2: How to tell what version of Perl a script needs?

Replies are listed 'Best First'.
Re^3: How to tell what version of Perl a script needs?
by Anonymous Monk on Apr 20, 2005 at 09:45 UTC
    Simple. Learn from the Java world: just distribute whatever version of Perl you need with your application.

    Problem solved.

Re^3: How to tell what version of Perl a script needs?
by cog (Parson) on Apr 19, 2005 at 18:49 UTC
    What about having the same perl version everywhere? And possibly centralize all your scripts/modules in a development server, where things could be properly tested when upgrading the existing version.

      Heh. A few months ago, I convinced them that a development server was a good thing to own; I'm still trying to convince them that they should actually use it. For the most part, they are still doing development and testing on the production machines. They have even gone so far as to tell me that the dev machine is "for my use", implying that there are no plans to have anyone else use it.

      I've recently raised the issue of putting all the templates in a centralized database. There are some legal reasons why this might be sticky, but I'm going to see if there isn't a way around them. In the meantime, they are very reluctant to change their Perl versions, since it often breaks the existing code when they upgrade.

        In the meantime, they are very reluctant to change their Perl versions, since it often breaks the existing code when they upgrade.
        Which is a very, very good reason to not upgrade.

        Luckely, there's nothing that prevents multiple versions of perl to be installed side-by-side.

Re^3: How to tell what version of Perl a script needs?
by tlm (Prior) on Apr 19, 2005 at 19:55 UTC
      Those tell me how to determine the version of perl ($^V) and how to enforce that that version be no lower than a particular release (require/use). They do not do what I am asking for. Thank you for the suggestion, though.

        Pardon me for being so dense, but after multiple readings of your posts on this thread, I am still scratching my head as to what you actually mean. You write:

        ...it suddenly occurred to me that, when they move the application I wrote around, it might break if the provided perl is too low. I would like to be able to put in a 'use XYZ' line to at least document what version is required.

        ...which to me sounds exactly what a statement like
        use v5.6.0;
        is supposed to do (the script will not compile with versions of perl below v5.6.0, and this is all documented in the links I posted). Therefore I am puzzled by your reply above.

        the lowliest monk