Does CPAN installing of new modules impact Perl-CGI applications on same live production server?

江枫思渺然 提交于 2019-12-10 11:17:37

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/4124843/does-cpan-installing-of-new-modules-impact-perl-cgi-applications-on-same-live-pr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!