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 | [reply] [d/l] [select] |
|
| [reply] [d/l] [select] |
|
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
| [reply] [d/l] [select] |
|
or call it from autoexec.bat, and reboot :)
| [reply] |
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.
| [reply] [d/l] [select] |
|
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?
| [reply] |
|
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.
| [reply] [d/l] [select] |
|
|
|
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
| [reply] |
|
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
| [reply] [d/l] [select] |
|
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".
| [reply] |
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
| [reply] [d/l] |
|
| [reply] [d/l] |
|
Ha, its a leftover from running multiple perls
| [reply] |
|
|
|
Strawberry USED to set those env variables, it doesn't any more.
| [reply] |