Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

How install multiple version of perl

by maria80e (Novice)
on Mar 31, 2020 at 07:04 UTC ( #11114830=perlquestion: print w/replies, xml ) Need Help??

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

I have the following question in perl.

1) Is it possible to install multiple version of perl(example perl version: 5.6 and perl version 5.24) in windows system.

2) How to call the perl file using version. For example, call the new version perl file(5.24) from old version of perl file(5.6).

Replies are listed 'Best First'.
Re: How install multiple version of perl
by swl (Priest) on Mar 31, 2020 at 07:17 UTC

    See perlbrew or, if on Windows, berrybrew. Their respective manuals instruct how to switch between versions.

    Edit - although berrybrew can only provide versions for which Strawberry Perl was released.

        That's correct. My, perhaps out of date, understanding was that the original repo was still used. It has commits on master up to v1.30, and the installer link points to stevieb's repo. stevieb can of course advise.

      But I AM using Active Perl
        As of berrybrew v1.26 (and newer), you can use berrybrew virtual to register an Active State installation to be controllable by berrybrew as well.

        If you are working with Perl on Windows, make life easier on yourself and switch to Strawberry.

        What's preventing you from switching?

Re: How install multiple version of perl
by Discipulus (Abbot) on Mar 31, 2020 at 09:07 UTC
    Hello maria80e,

    in addition to what already said, you can simply use portable versions of StrawberryPerl. These versions ship with a portableshell.bat launcher wich avoids collision with other perl versions eventually present in the system (by simply prepending itself in PATH with set PATH=%~dp0perl\site\bin;%~dp0perl\bin;%~dp0c\bin;%PATH% ).

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: How install multiple version of perl
by kcott (Bishop) on Apr 01, 2020 at 03:21 UTC

    G'day maria80e,

    To answer your first question: yes, this is entirely possible. I'm running Win10 and currently have five Perls installed: ActivePerl 5.16.3; Strawberry Perl 5.26.3 and 5.30.0; Git Bash Perl 5.26.2; and, Cygwin Perl 5.30.0.

    I recently ran into some issues installing a second Strawberry Perl (the 5.26.3 one). I asked about that here: "Strawberry Perl - installing an older version" — I received a lot of advice, some of which you may find useful.

    I see your second question has already been answered: "Re: How install multiple version of perl".

    — Ken

Re: How install multiple version of perl
by akuk (Beadle) on Apr 02, 2020 at 03:30 UTC

    Perlbrew is definitely the leader in managing the multiple versions of Perl. There is an alternative to it and it is "plenv".

    I used it in one of my clients projects (Client already had it in systems). I wasn't disappointed at all using the plevnv with carton to manage the module and perl version dependencies.

    Git repo for plenv is here.

Re: How install multiple version of perl
by Anonymous Monk on Mar 31, 2020 at 09:18 UTC
      I am using active perl. Is it possible for Active perl?
        I didn't try it, but I think it SHOULD be possible to mix an installed ActivePerl with one ore even several Portable editions of Strawberry Perl. You will, however, have to always(!)
        • call each StrawberryPerl using its corresponding portableshell.bat (even the scripts with C:\Path\To\portableshell.bat D:\Path-to\yourscript.pl),
        • same for ActivePerl, perhaps you'd need to setup a Batch (or CMD) file similiar to the portableshell.bat
        And of course, module installations/updates have to be done also for each version independently (for Strawberry, berrybrew might help you with it).
        Of course it is . try it

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11114830]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2020-11-30 23:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?