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 . my_environment/bin/activate wget http://.../foo-0.1.tar.gz tar -xzf foo-0.1.tar.gz ; cd foo-0.1 perl Makefile.pl 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:
@INC
in the process where it's used.PERL5LIB
and other such things for child processes.MakeMaker
, Module::Build
, etc. to install libraries and store configuration in a local directory.PATH
so that installed binaries can be found.eval $(perl -Mlocal::lib)
in your .profile
and then mostly forget about it.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With