in reply to Multiple instances of Perl

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.

Replies are listed 'Best First'.
Re^2: Multiple instances of Perl
by linuxer (Curate) on May 14, 2008 at 21:02 UTC

    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.

Re^2: Multiple instances of Perl
by jabberwocky (Novice) on May 14, 2008 at 19:20 UTC
    Thank you, Anonymous Monk, that was very helpful