How can I install specialized environments for different Perl applications?

后端 未结 8 1134
轻奢々
轻奢々 2021-01-31 19:00

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

8条回答
  •  醉酒成梦
    2021-01-31 19:30

    What I do is start the CPAN shell (cpan) and install my own Perl 5.10 from it (I believe the command is install perl-5.10). This will ask for various configuration settings; I make sure to make it point to paths under /usr/local (or some other installation location other than the default).

    Then I put its resulting location in my executable $PATH before the standard perl, and use its CPAN shell to install the modules I need (usually, a lot). My Perl scripts all start with the line

    #!/usr/bin/env perl
    

    Never had a problem with this approach.

提交回复
热议问题