in reply to Re: Common module lib across Perl versions on same system
in thread Common module lib across Perl versions on same system

Thanks. I've heard of berrybrew, but I was under the assumption is just helped manage different instances of Perl - which I do already. It'd still have the same issue of having to install non-core modules in each version of Perl, correct?

  • Comment on Re^2: Common module lib across Perl versions on same system

Replies are listed 'Best First'.
Re^3: Common module lib across Perl versions on same system
by stevieb (Canon) on Jan 18, 2017 at 23:04 UTC

    stevieb here, the person who took over and now maintains berrybrew (thanks for the mention, dasgar!).

    At this time, there is no built-in way to manage external lib directories outside of each Perl instance, but it is on my roadmap (after I get my RasPi work completed).

    Personally, I like each instance to have its own installation of modules, but I digress. It's been requested of me to build in the ability that you're asking for, and as I said, it's on the roadmap. For now, you can do what you're doing, or shift out @INC (unshift @INC, '/path/to/libs'). Some modules will break, others won't.

    If you want an easy way to install a module on all Perl instances with berrybrew and avoid using a single lib dir:

    berrybrew exec cpanm Module::Name

    That'll install the module on all installed Perl instances. If you have a module to install but it won't work on some version, I've added in the ability to exec on certain versions only (NOTE: no space between the perl versions!):

    berrybrew exec --with 5.24.0_64,5.10.1_32 cpanm Module::Name

    If you have any problems or issues, or want to discuss options on how you'd like to see a lib option be implemented, feel free to open an issue on the berrybrew link above (my github), or message me here and I can send over my email address.

    update: To boot, if you're working with Strawberry Perl portable editions, you can incorporate them into berrybrew by copying/moving the instance directory into c:\berrybrew directory, and ensure that it is named exactly the same as one of the entries in berrybrew available. Thereafter, you can clone it to whatever name you want. I did not get as far in the Perl registration logic to allow just dumping any old directory into the berrybrew dir and have it auto-register, but that feature isn't far off either./update