Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Multiple perl instances

by czth (Sexton)
on Feb 25, 2004 at 22:36 UTC ( [id://331862]=perlquestion: print w/replies, xml ) Need Help??

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

We want to have 2 perl installs, both 5.6.1, one for development and one for testing, on the same machine (please don't suggest we use another machine; we are elsewhere but not for this development). One lives under /foobar (e.g. /foobar/bin/perl, @INC has /foobar/lib/perl5/site_perl etc. in it), the other would be /foodev.

Since foobar and foodev are the same length, I assume I can copy and patch the perl binary intelligently to change the built-in @INC path, and then just copy the lib tree, looking for occurances of foobar and patching them too (e.g. Config.pm). Are there any other gotchas? It seems like a gross hack to me too, but it's a heck of a lot faster than reinstalling perl and all of our CPAN modules.

Replies are listed 'Best First'.
Re: Multiple perl instances
by borisz (Canon) on Feb 25, 2004 at 22:56 UTC
    What is wrong with compiling a new perl into another location? Read the file INSTALL into the perl distribution. Look for the options your perl is build ( perl -V ) and change the prefix ( -dprefix=/foobar ).
    Boris
Re: Multiple perl instances
by waswas-fng (Curate) on Feb 25, 2004 at 22:57 UTC
    Think about using par for your setup. It allows you to build an all inclusive par or executable for your project. You can then have a true frozen gold copy for qa -> release and know that all of your modules and dependancies are locked in time for a release. If you can't use that or some other better way, patching the perl binary as long as the same string length is used should work, as should doing the same through the lib tree. but that seems awfully messy to me.


    -Waswas
Re: Multiple perl instances
by eyepopslikeamosquito (Archbishop) on Feb 26, 2004 at 07:45 UTC

    I don't think it's a gross hack. I've done this sort of thing before to avoid the dreaded LD_LIBRARY_PATH.

    I noticed the ActiveState Perl distribution has a reloc_perl script that seems to be designed to do just this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found