CPAN 安装新模块是否会影响同一实时生产服务器上的 Perl-CGI 应用程序?

发布于 2024-10-01 21:30:34 字数 131 浏览 0 评论 0原文

我在 CentOS Linux 网络服务器上有一些 Perl/CGI 程序。我希望编写更多需要当前未安装的 Perl 模块的应用程序。

在同一实时生产服务器上运行 CPAN 是否会以任何方式影响这些程序(显然,当前不使用这些模块)?

I have some Perl/CGI programs on a CentOS Linux webserver. I wish to write further applications that require Perl modules not currently installed.

Does running CPAN on the same live production server impact these programs (which currently don't use the modules, obviously) in any way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

因为看清所以看轻 2024-10-08 21:30:34

有一种可能的方式可以产生效果。如果您正在安装的模块需要您已经使用的模块的较新版本,那么这些较新版本可能会影响现有程序的行为。

例如。假设您当前安装了 Foo.pm 1.0 版本。您现在想要安装一个名为 Bar.pm 的新模块。但 Bar.pm 依赖于 Foo.pm 的 2.0 版本 - 因此,CPAN 将在安装 Bar.pm 的过程中引入更新版本的 Foo.pm。在最坏的情况下,Foo.pm 的作者可能会完全更改版本之间模块的接口。在这种情况下,任何使用 Foo.pm 1.0 的程序都可能在安装 2.0 版后停止工作。

这是不太可能的,因为 Perl 模块通常努力保持向后兼容性。但这就是为什么我们有测试环境和测试套件,并且在没有先进行彻底测试的情况下不会将其投入生产。

There's one possible way that it could have an effect. If the modules you are installing require newer versions of modules that you are already using, then it's possible that these newer versions could affect the behaviour of your existing programs.

For example. Suppose you currently have version 1.0 of Foo.pm installed. You now want to install a new module called Bar.pm. But Bar.pm depends on version 2.0 of Foo.pm - and CPAN will therefore pull in a newer version of Foo.pm as part of the installation of Bar.pm. In the worse case scenario, the author of Foo.pm could have completely changed the interface of the module between versions. In that case any program that uses Foo.pm 1.0 could stop working when version 2.0 is installed.

It's very unlikely as Perl modules usually work hard to maintain backwards compatibility. But this is why we have testing environments and test suites and don't put stuff into production without testing it thoroughly first.

梦魇绽荼蘼 2024-10-08 21:30:34

是的,新安装的模块将可用于您的 Perl/CGI 环境,假设您用于从 CPAN 安装模块的 perlperl 相同 Web 服务器用来运行 Perl/CGI 应用程序。例如,如果您使用 /opt/local/bin/perl 安装模块,并且 Web 服务器执行 /usr/bin/perl 下的应用程序,则两个 perl(通常)每个都有自己的一组已安装模块,因此 Web 服务器不会看到它们。

Yes, the newly-installed modules will be available to your Perl/CGI environment, provided that the perl you use to install the modules from CPAN is the same perl that the web server uses to run the Perl/CGI applications. e.g., If you install the modules using /opt/local/bin/perl and the web server executes the apps under /usr/bin/perl, then the two perls will (usually) each have their own set of installed modules, so the web server won't see them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文