1

I want to setup a single Perlbrew installation to share among my team, so they don't all have to compile versions of Perl separately. So I set PERLBREW_ROOT and then installed Perlbrew on a network drive. Then I started sourcing the bashrc from my .profile-user file.

So far so good, but I'm not sure what to tell them to do. The documentation says every user needs to run "perlbrew init" first, but I never did that myself. Everything I did is in the first paragraph.

At any rate, what steps should I tell them to run?

0

1 Answer 1

2

First of all, pass -Duserelocatableinc to perlbrew when installing a build of Perl to avoid problems that will arrise from differences in the paths used to access the installed perl.


If the other users simply want to use one of the perlbrew-installed builds of Perl, they simply need to point the shebang line of their script to the perl inside the perlbrew directory as usual.

For example, if PERLBREW_ROOT is /home/ikegami/usr/perlbrew and the perlbrew label for the install is feed_fetcher, one would use

#!/home/ikegami/usr/perlbrew/perls/feed_fetcher/bin/perl

If the other users also want to install modules and/or use scripts installed by modules (e.g. Module::CoreList's corelist, Unicode::Tussle's uniprops, etc), they must also do the following:

  1. In their login script, add

    export PERLBREW_ROOT=/.../perl5/perlbrew
    
  2. In their shell startup script, add

    source "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}"/etc/bashrc
    

You can technically skip the first step, but only if the path hardcoded in etc/bashrc is correct for that user.

6
  • What is "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}" all about? why not just source /.../perl5/perlbrew/etc/bashrc?
    – Stephen
    Commented Dec 31, 2017 at 0:16
  • Also you didn't mention perlbrew init, should I be telling them to run that too?
    – Stephen
    Commented Dec 31, 2017 at 0:20
  • As for my first comment I don't understand the syntax of :-
    – Stephen
    Commented Dec 31, 2017 at 0:25
  • Re "Also you didn't mention perlbrew init", That wasn't a mistake.
    – ikegami
    Commented Dec 31, 2017 at 2:01
  • Re "I don't understand the syntax of :-", It provides a default if PERLBREW_ROOT isn't set.
    – ikegami
    Commented Dec 31, 2017 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.