tokuhirom / plenv

Perl binary manager
Other
516 stars 71 forks source link

Plenv to control additional Perl lib paths (PERL5LIB env var?) #164

Closed mikkoi closed 3 years ago

mikkoi commented 4 years ago

I work with several distributions which have interdependencies. There are, for example, service-server, service-client and service-common. The last contains packages user by both server and client side code. I normally keep these in parallel directories. When I run tests (prove) or scripts in either dir service-server or dir service-client, I need to add ../service-common/lib to env var PERL5LIB (or call perl -I../service-common/lib.

Could plenv take care of this? Perhaps there could be file .perl-libdirs next to file .perl-version? This file would use PERL5LIB syntax: dir:other_dir.

mikkoi commented 4 years ago

I created a pull request for a possible solution.

mikkoi commented 4 years ago

Instead of changing plenv-exec, could the same thing be done with the hooks?

skaji commented 4 years ago

You can create your own plugins. See, for example, https://github.com/miyagawa/plenv-contrib

mikkoi commented 4 years ago

@skaji Thanks. I used plenv-contrib as a model but mine is more complicated because it needs to change the way plenv-exec works.

skaji commented 4 years ago

I see.

mikkoi commented 4 years ago

Where can I find instructions on how to use the hooks?

mikkoi commented 3 years ago

Implemented as a plugin and hook in https://github.com/mikkoi/plenv-libdirs