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

Setting up perlbrew for Linux and Solaris

by bergbrains (Acolyte)
on Nov 01, 2011 at 15:38 UTC ( [id://935145]=perlquestion: print w/replies, xml ) Need Help??

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

I am building new versions of Perl for two environments; Linux and Solaris. We still have just a few jobs that run on Solaris otherwise I'd bail on Solaris in a huge way, but for now, I need both, so I chose perlbrew to facilitate the builds.

What's the best way to set up perlbrew for this? After a bunch of playing around and testing, I arrived at the approach in which I install a single instance of perlbrew in the default location (~/perl5/perlbrew) and then set PERLBREW_HOME to directories that differ only in the final path element, which is derived from `uname -p`, but that doesn't seem to provide the separation that I really need. Additionally, the docs suggest that, on the related topic of building for two different hosts, I set both PERLBREW_HOME and PERLBREW_ROOT, though there is no indication as to whether in this case, PERLBREW_ROOT should be set prior to installation of perlbrew.

The problem I'm having is that it's not clear what the PERLBREW_HOME and PERLBREW_ROOT actually do in the context of installing perls and using different ones on different platforms.

So, the options appear to be 1) installing perlbrew into the default location and then setting PERLBREW_HOME for subsequent Perl installs; or 2) installing perlbrew into separate locations on each platform, setting PERLBREW_ROOT on each platform prior to installation, and then setting PERLBREW_HOME appropriately on each platform.

Can anyone provide guidance or clarity here? Thanks.

  • Comment on Setting up perlbrew for Linux and Solaris

Replies are listed 'Best First'.
Re: Setting up perlbrew for Linux and Solaris
by Anonymous Monk on Nov 01, 2011 at 19:36 UTC

    I don't understand the question :)

    I think the answer is either-or, pick-one :)

    It is based on reading

    http://search.cpan.org/grep?cpanid=GUGOD&release=App-perlbrew-0.30&string=PERLBREW_ROOT&i=1&n=1&C=0
    our $PERLBREW_ROOT = $ENV{PERLBREW_ROOT} || "$ENV{HOME}/perl5/perlbrew
    139: setenv PERLBREW_ROOT "$HOME/perl5/perlbrew" 149: setenv PERLBREW_PATH "$PERLBREW_ROOT/bin"

    perlbrew

    If latter on you need to change $PERLBREW_ROOT, you (and all other users who share the same $PERLBREW_ROOT will have to run this again to make it affective.

    PERLBREW_ROOT

    By default, perlbrew builds and installs perls into $ENV{HOME}/perl5/perlbrew directory. To use a different directory, set this environment variable in your bashrc to the directory before running perlbrew.

    App::perlbrew

    By default, perlbrew looks for the intialization file that exports PERLBREW_ROOT in ~/.perlbrew/init. In some cases (for instance, if your home directory is shared across multiple machines), you may wish to have several different perlbrew setting per-machine. If so, you can use the PERLBREW_HOME environment variable to tell perlbrew where to look for the initialization file
    # on machine a $ PERLBREW_HOME=~/.perlbrew-a PERLBREW_ROOT=~/perl5/perlbrew-a ./perl +brew install # on machine b $ PERLBREW_HOME=~/.perlbrew-b PERLBREW_ROOT=~/perl5/perlbrew-b ./perl +brew install
    If you specify PERLBREW_HOME, you will also need to specify both PERLBREW_HOME and PERLBREW_ROOT when you first install perlbrew. After that, you'll need to make sure PERLBREW_HOME is exported when you log in, before you source $PERLBREW_ROOT/etc/bashrc (or cshrc). Example .bashrc:

Log In?
Username:
Password:

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

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

    No recent polls found