Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

How to have multiple Perls under Windows

by adamsj (Hermit)
on Aug 14, 2001 at 07:41 UTC ( [id://104670]=perlquestion: print w/replies, xml ) Need Help??

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

My travails with IO::Socket under WinME (and I've now gotten the same problem with Win2000) are documented elsewhere and a possible reason for it has been given. I'm going to fire up my "laptop" (which needs a monitor and a keyboard to work...sigh) and try putting the client and the server on separate machines and see if that doesn't fix my problem--but I'm thinking there's yet more to do.

It occurred to me that this odd behavior might be an artifact of the ActiveState implementation in particular, rather than just how things were under Windows, so I decided I'd put a different Perl on my machine and see what happens.

Then, the question arose in my mind, "What if I had two different versions of Perl--say, ActiveState and IndigoPerl--running on the same machine, and started the client with one and the server with the other--what then?"

This led me to the $64,000 dollar question--"How badly am I going to screw up my machine by putting (or, more likely, trying to put) multiple Perls on it? I know how to do this on UNIX, but on Windows...hmm."

Being foolhardy, I went ahead and tried putting IndigoPerl on, and it's not cooperating. I suppose trying SiePerl is next, but I wonder--does anyone else have experience, frightening or otherwise, with this silly idea?

adamsj

They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen

  • Comment on How to have multiple Perls under Windows

Replies are listed 'Best First'.
Re: How to have multiple Perls under Windows
by John M. Dlugosz (Monsignor) on Aug 14, 2001 at 10:01 UTC
    I looked at the "context" stuff reciently, and the current version of ActiveState Perl automatically generates the normal @INC paths from the location of the main .exe you ran. It also looks in the registry, but you can leave it blank and do without--use @ENV only, which is easy to localize to a shell instance.

    If the .dll files have different names (version number in the name), then again no big deal. If they have the same name but are different (like MS does with MFC) you can simply put the corresponding .dll in the same directory with the .exe and it's found there first.

    To explore (or debug) the issues, download RegMon and FileMon from www.sysinternals.com and see what files and registry keys it actually uses at run-time.

    I think it should be no big deal.

    As for getting the desired version to run automatically on the command-line, use a batch file like "setperl xxy" or "setperl yyz" to switch which one is associated with .pl and .perl files. I do that with C++ versions by changing the PATH environment variable.

    —John

Re: How to have multiple Perls under Windows
by clemburg (Curate) on Aug 14, 2001 at 19:37 UTC

    I use a WinNT machine with two versions of ActiveState Perl installed in two different directory trees next to each other.

    I usually use an environment variable set to the location of the "right" one of the two perl interpreters (perl.exe) to switch between the two versions. I have not set up any file type associations, but use ".bat" files to call the perl scripts (pl2bat is your friend).

    This has worked well for me until now.

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com

Replying to my own node--how sad!
by adamsj (Hermit) on Aug 14, 2001 at 08:39 UTC
    Well, it turned out that I posted too quickly on the assumption that, if IndigoPerl wouldn't easily install, I was going to run into mucho problemos. SiePerl did install easily (that's not a slam at IndigoPerl, by the way).

    Apparently, the way you do this is, put the other perl somewhere else and then call it with the full path name.

    Seems like I've heard that somewhere before--oh, and it didn't fix my problem. Neither using two different Perls to run the client and the server nor using SiePerl for both eliminated the blocking. adamsj

    They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found