使用 Perl 处理开发/生产库路径的好方法是什么?
使用 Perl,处理不同开发与生产库路径的简单方法是什么? 我想使用本地盒子路径进行测试,但是当我启动时,我希望它自动指向生产库路径。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 PERL5LIB 环境变量,或者为了更简单,请查看local::lib。
Take a look at the PERL5LIB environment variable, or for an even easier time, look at local::lib.
我认为您的开发盒实际上应该是一个与生产环境具有相同配置的虚拟机,因此您不需要更改库路径。
库应该通过相同的机制安装,以便一切都一致。
由于库版本差异,不这样做可能会导致您将无法工作的代码发布到生产环境中。
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.