in reply to Multiple Versions of Perl

Yes you can. Another important consideration that modules installed in one "environment" will not exist in the other.

I've done something similar to house multiple development and testing environments on the same server.

UPDATE: Limbic~Region was kind enough to point out that it may exist in both environements if you set @INC to include your "development" include directory.

Taking his idea one step further (I think he was hinting at this in his message to me): set @INC to reference a local environment variable that points to your "current" directory structure of includes. That way, you set an environment variable before execution, and never have to change the actual script as you migrate from env to env. The one major drawback to this approach that I can see is security. If someone can change the environment variable, they could overload the @INC to include potentially malicious modules.

Thoughts? Rebuttal?

Replies are listed 'Best First'.
Re^2: Multiple Versions of Perl
by Limbic~Region (Chancellor) on Sep 07, 2004 at 20:14 UTC
    eLore,
    I should have taken the time to respond properly but I had a meeting to go to and just /msg'd you. My point was that there is nothing preventing two different installations/versions/configurations of Perl from having one or more of the same @INC paths. This may or may not be a good thing. Compatability usually comes into question at some point. You can modify @INC in several ways -
    • Compile time option
    • PERL5LIB environment variable
    • use lib pragma
    Chances are you wouldn't unintentionally cross paths and if you did do so intentionally it is because you know what you are doing. For those who get strange error messages with multiple versions - this might be something to look at. I have personally had problems with a Cygwin installation and ActiveState.

    Cheers - L~R