Is there anything equivalent or close in terms of functionality to Python's virtualenv, but for Perl?
I've done some development in Python and a possibility of having non-system versions of modules installed in a separate environment without creating any mess is a huge advantage. Now I have to work on a new project in Perl, and I'm looking for something like virtualenv, but for Perl. Can you suggest any Perl equivalent or replacement for python's virtualenv?
I'm trying to setup X different sets of non-system Perl packages for Y different applications to be deployed. Even worse, these applications may require different versions of the same package, so each of them may require to be installed in a separate module/library environment. You may want to do this manually for X < Y < 3. But you should not do this manually for 10 > Y > X.
Ideally what I'm looking should work like this:
perl virtualenv.pl my_environment
tar -xzf foo-0.1.tar.gz ; cd foo-0.1
make install # <-- package foo-0.1 gets installed inside my_environment
perl -MCPAN -e 'install Bar' # <-- now package Bar with all its deps gets installed inside my_environment
There's a tool called
local::lib that wraps up all of the work for you, much like
virtualenv. It will:
@INCin the process where it's used.
PERL5LIBand other such things for child processes.
Module::Build, etc. to install libraries and store configuration in a local directory.
PATHso that installed binaries can be found.
eval $(perl -Mlocal::lib)in your
.profileand then mostly forget about it.