Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

"Strawberry Perl" - can it live together with ActivePerl 5.10.0 Build 1003 (on WinXP)?

by meorero (Sexton)
on Aug 24, 2008 at 08:29 UTC ( [id://706512]=perlquestion: print w/replies, xml ) Need Help??

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

Hi all. A question (already asked on Chatterbox):
"Strawberry Perl" - can it live together with ActivePerl 5.10.0 Build 1003 (on WinXP)?
I want to try "Strawberry Perl".
I have ActivePerl 5.10.0 Build 1003 (on WinXP).
Did anyone tried to use "Strawberry Perl" together with ActivePerl 5.10.0?
Can ActivePerl 5.10.0 interfere, or disturb "Strawberry Perl"?
And my Perl scripts - which one of them it will use? How is it defined?
Can I define for a script which Perl to use?
  • Comment on "Strawberry Perl" - can it live together with ActivePerl 5.10.0 Build 1003 (on WinXP)?

Replies are listed 'Best First'.
Re: "Strawberry Perl" - can it live together with ActivePerl 5.10.0 Build 1003 (on WinXP)?
by syphilis (Archbishop) on Aug 24, 2008 at 09:37 UTC
    Yes, you can have as many different perls as you want on the one machine without having any interference problems - so long as you install them to separate locations and, while installing them, you don't let any of them alter the system path. (If they do add their own location to the system path during installation, then it's no big deal - you just undo those changes as soon as the installation has completed.)

    Then it's just a matter of setting the system path variable to find whichever perl you want to use. For me, that means that for Strawberry Perl I run:
    set PATH=C:\strawberry\perl\bin;%PATH%
    If I want to run ActivePerl build 1003:
    set PATH=C:\ap1003\bin;%PATH%
    And for ActivePerl build 822:
    set PATH=C:\ap822\bin;%PATH%
    Rather than remembering where all of these different perls are installed, it's easier to put those commands in separate batch files, and then just run the appropriate batch file for whichever perl you want. For example, if I want to use ActivePerl build I just run ap822.bat which sets the path (and any other environment variables I might want set) appropriately for me.

    Can I define for a script which Perl to use?

    I don't think so (if I understand the question correctly). Any time "perl" is invoked, it will be the first "perl" executable to be found that will be run. You can, of course, always call a specific perl executable by quoting the full path to it - eg C:\strawberry\perl\bin\perl script.pl will always run C:\strawberry\perl\bin\perl.exe no matter which "perl" (if any) comes first in the path environment variable.

    Cheers,
    Rob
        You'd have to use set every time you open a new terminal

        Effectively, yes. But it's much simpler to just enter ap1003 and have ap1003.bat "set" the environment as you want.

        Cheers,
        Rob
        or call it from autoexec.bat, and reboot :)
Re: "Strawberry Perl" - can it live together with ActivePerl 5.10.0 Build 1003 (on WinXP)?
by binf-jw (Monk) on Aug 24, 2008 at 09:19 UTC
    As far as I know when I've had both installed I couldn't used ActivePerl due to Strawberry Perl already being first installed. You could try installing them in different locations if it's possible and use the full path to it.
    For example:
    UPDATE: These paths for example only see syphilis post for best answer.
    C:\> C:\StrawberryPerl\Perl\bin\perl.exe perl_script.pl
    or
    C:\> C:\ActivePerl\Perl\bin\perl.exe perl_script.pl
    I've never tried it, but it seems logical, Hope it helps. As I'm sure know there are three distributions of Win32 Perl http://win32.perl.org/wiki/index.php?title=Main_Page#Installing_Perl_on_Windows_for_the_First_Time.3F It all depends on your needs. My only quarrel with Strawberry Perl is it doesn't ship with Win32::* which when changing machines and installing Perl as much as I do can be frustrating as I regularly need it.

      Thanks for the reply - I'll try it.

      ActivePerl was quite Ok for me till now.

      But now I have to install CPAN modules.

      I did not find a pre-built PPM package for ActivePerl.
      And It needs a compilation.

      So ... As far as I understood - it's much easier with Strawberry Perl.
      Am I correct?

        But now I have to install CPAN modules.

        I did not find a pre-built PPM package for ActivePerl.
        And It needs a compilation.

        You can use MinGW (gcc for Windows) to install XS modules for ActivePerl, with CPAN. Really! I do it all the time.

        Go to the download page, and download the installer, the first link. It's a file of about 140k. Run it. It'll download and install the packages you need.

        You also need a make utility, which you already need when building plain utilities with CPAN. For XP, Microsoft's nmake works fine, but alternatively you can use dmake too, allegedly.

        When ActivePerl detects that you have MinGW and don't have Microsoft's Visual C, it'll monkeypatch Config into using it for building modules instead.

        Am I correct?

        Yes and no (with a liberal sprinkling of "depend"s and "maybe"s).

        The good thing about Strawberry Perl is that it gives you all the components you need to compile modules in one simple download. You can get the same mileage out of ActiveState, but you first need some separate downloads and a bit of fiddling to get things configured right.

        If there really is no PPM available for the particular module you need, then that's a good indication that the module you need probably won't build on Windows (even with Strawberry Perl). Installing Strawberry Perl is the first step in finding that out. I encourage you to take that step.

        Cheers,
        Rob
        I've got ActivePerl installed at work and ppm is definitely installed. And seeing as our IT department had to Install the active perl I seriously doubt it wasn't pre-built. Run it like this (obv):
        ppm
        Think you can even access it from the start menu under ActivePerl. I've had some issues installing modules like TK. But other then that it's been fine. Also had some issues with Proxy server but that can be fixed as follows:
        >SET HTTP_proxy=http://aproxy:80 >SET HTTP_proxy_user=person >SET HTTP_proxy_pass=password >ppm
        Am I right to hear that you are installing Strawberry Perl because you could not find some *.ppms? Have you looked in other "repositories" besides ActiveState's?

        This is the only repository searched by default. You can add others by "ppm"->"Edit"->"Preferences"->"Repositories", and choosing additional repositories from the "Add Repository"->"Suggested" drop-down box.

        You can also simply enter the URL for others you may find that are not yet "suggested".

Re: "Strawberry Perl" - can it live together with ActivePerl 5.10.0 Build 1003 (on WinXP)?
by Anonymous Monk on Aug 24, 2008 at 09:36 UTC
    sure, as long as you don't install activeperl in C:\strawberryperl, and you fix your %ENV, you're good to go. Here's what I use
    set INCLUDE=;C:\strawberry\c\include;C:\strawberry\perl\lib\CORE set LIB=;C:\strawberry\c\lib;C:\strawberry\perl\bin set path=%windir%\system32 set path=%path%;%windir% set path=%path%;%windir%\System32\Wbem set path=%path%;C:\strawberry\perl\bin\ set path=%path%;C:\strawberry\c\bin set path=%path%;%programfiles%\gnuwin32\bin set path=%path%;%programfiles%\GNU\GnuPG @rem @echo ... set TMPDIR=
    after that cpan/cpanp correctly calls the strawberry version
      set INCLUDE=;C:\strawberry\c\include;C:\strawberry\perl\lib\CORE set LIB=;C:\strawberry\c\lib;C:\strawberry\perl\bin
      It is pointless setting the LIB and INCLUDE environment variables. They are not used by Strawberry Perl(afaict) and MinGW certainly makes no use of them.

      Mind you, they probably do no harm - unless you subsequently start using a Microsoft Compiler (Visual Studio *does* take notice of the LIB and INCLUDE variables). Even then, it might not cause any problems.

      It's just a potential cause for confusion, that's all. People see that Strawberry sets those environment variables, and think it must serve a purpose. But it doesn't :-)
      I removed them from my Strawberry env vars long ago, without any ill effect.

      Cheers,
      Rob
        Ha, its a leftover from running multiple perls
        Strawberry USED to set those env variables, it doesn't any more.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-19 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found