perlperlbrew

sharing a perlbrew installation among multiple users


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?


Solution

  • 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.