使用Perl处理开发/生产库路径的好方法是什么?

时间:2021-08-14 23:31:22

With Perl, what is an easy way to handle different development versus production libs paths? I want to use my local box path for testing, but when I launch I want it to automatically point to the production lib path.

使用Perl,处理不同开发与生产库路径的简单方法是什么?我想使用我的本地盒子路径进行测试,但是当我启动时,我希望它自动指向生产库路径。

2 个解决方案

#1


Take a look at the PERL5LIB environment variable, or for an even easier time, look at local::lib.

看看PERL5LIB环境变量,或者更容易看看local :: lib。

#2


I think your dev box should really be a VM with an identical configuration to production, so you won't need to change the library path.

我认为你的开发盒应该是一个与生产配置完全相同的虚拟机,所以你不需要改变库路径。

Libraries should be installed by the same mechanism so everything's consistent.

应该通过相同的机制安装库,以便一切都是一致的。

Not doing this is likely to risk you releasing non-working code to production due to library version differences.

由于库版本的差异,不这样做可能会使您将非工作代码发布到生产中。

#1


Take a look at the PERL5LIB environment variable, or for an even easier time, look at local::lib.

看看PERL5LIB环境变量,或者更容易看看local :: lib。

#2


I think your dev box should really be a VM with an identical configuration to production, so you won't need to change the library path.

我认为你的开发盒应该是一个与生产配置完全相同的虚拟机,所以你不需要改变库路径。

Libraries should be installed by the same mechanism so everything's consistent.

应该通过相同的机制安装库,以便一切都是一致的。

Not doing this is likely to risk you releasing non-working code to production due to library version differences.

由于库版本的差异,不这样做可能会使您将非工作代码发布到生产中。