开发者

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

开发者 https://www.devze.com 2023-01-23 20:27 出处:网络
I have some Perl/CGI programs on a CentOS Linux web开发者_如何学Pythonserver. I wish to write further applications that require Perl modules not currently installed.

I have some Perl/CGI programs on a CentOS Linux web开发者_如何学Pythonserver. 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消