http://www.perlmonks.org?node_id=1027528

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

i'm switching from active perl to strawberry. wasn't given a choice. I have both active and strawberry intalled on my windows server. my question is this. other than changing the environment path each time, is there a way to use one or the other at my discretion?

Replies are listed 'Best First'.
Re: active and stawberry concurrently
by BrowserUk (Patriarch) on Apr 08, 2013 at 15:13 UTC
    other than changing the environment path each time

    The simplest solution would be to duplicate the perl.exe's in each of the two builds under different names (say) aperl.exe and sperl.exe and then add both bin directories to your path.

    That way you can easily select which to use for any given command and by putting your preferred one first in the path, it will be used by default.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: active and stawberry concurrently
by hdb (Monsignor) on Apr 08, 2013 at 14:56 UTC

    There is a Strawberry Portable edition which will run completely standalone. It has something called portableshell.bat which isolates everything.

Re: active and stawberry concurrently
by VinsWorldcom (Prior) on Apr 08, 2013 at 15:37 UTC

    I use 'junction' to switch between the different versions of Strawberry on my computer as detailed here: Multiple Strawberry Perl Versions under Windows.

    There is a concern about only changing the environment paths in that in the registry, HKCR holds a mapping to the executable for Perl. By making the path that points to a junction, you can switch the exectables on the back end without remapping.

Re: active and stawberry concurrently
by 2teez (Vicar) on Apr 08, 2013 at 16:07 UTC
    Hi,

    If I may add my 2 'kobo' advice to answers that has been given already.
    Modifying your PATH to specify which Perl interpreter to use using bat files can be alot easier
    And that you can achieve in so many ways. I have both ActivePerl and Strawberry Perl installed and I switch between both using simple bat files to modify my PATH like so:

    • activePerl.bat file
      rem Return Perl to ActivePerl path path; path D:\Perl\site\bin;D:\Perl\bin;C:\PHP\;C:\Program Files\PC Connec +tivity Solution\;%SystemRoot%\system3;%path% rem clear the screen cls
    • strawberryPerl.bat file
      rem Add Strawberry Perl to path path C:\strawberry\perl\bin;%path% rem clear the screen cls

    • All I do after then is to run any of these bat files to switch.
      If you tell me, I'll forget.
      If you show me, I'll remember.
      if you involve me, I'll understand.
      --- Author unknown to me
Re: active and stawberry concurrently
by Anonymous Monk on Apr 08, 2013 at 17:19 UTC
    I suggest that you switch. Remove the active from your system completely, then install strawberry, then reinstall all the packages you need to make your software work cleanly. The alternative is: hassle and no benefit.