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

Hello, all. I have a simple question, I think, but haven't been able to find a defintive answer. Is it possible for two instances of Perl, different versions, to coexist on a server? We're running Bugzilla, Perl MySQL, need to know whether I need to purchase a 3rd party tool. Thanks,

Replies are listed 'Best First'.
Re: Multiple instances of Perl
by almut (Canon) on May 14, 2008 at 17:18 UTC
    Is it possible for two instances of Perl, different versions, to coexist on a server?

    In general, yes :) — as long as you're careful to always call the right perl binary and not mess with PERL5LIB etc. (normally, each perl should know about and find its associated modules...)

      Thank you, almut
Re: Multiple instances of Perl
by dragonchild (Archbishop) on May 14, 2008 at 18:23 UTC
    I released Perl::Install specifically to aid in managing multiple Perl installations.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
      Thank you, dragonchild
Re: Multiple instances of Perl
by ikegami (Patriarch) on May 14, 2008 at 17:21 UTC
    Yes, just install them to different directories. I have 4 versions of Perl on my machine.
Re: Multiple instances of Perl
by Anonymous Monk on May 14, 2008 at 18:30 UTC

    Yes you can have as many versions of Perl as you like. Say you wish to retain your current perl which will have either a binary or a link in /usr/bin/perl (this is a good idea as installing a new perl should not break anything old). First install the new perl somewhere (say 5.8.8), then create a symlink.

    $ ln -s /usr/local/new_perl5.8.8_dir/bin/perl /usr/bin/perl588 Then you just need to do #!/usr/bin/perl588 to use it in a script and $ perl588 Makefile.PL or $ perl588 -MCPAN -e 'shell' to install modules into that new Perl.

      What about that .cpan directory in user's home directory?

      Is it really safe to have and use the same $HOME/.cpan directory (and same $HOME/.cpan/CPAN/MyConfig.pm) for different perl versions and installations?

        Is it really safe to have and use the same $HOME/.cpan directory (and same $HOME/.cpan/CPAN/MyConfig.pm) for different perl versions and installations?

        It should be fine, if you have the same (or at least a similar) version of CPAN installed and want to use the same options for all installations.

      Thank you, Anonymous Monk, that was very helpful
A reply falls below the community's threshold of quality. You may see it by logging in.