简体   繁体   English

为什么不鼓励在Windows上使用带有Strawberry perl的PPM perl模块?

[英]Why is it discouraged to use PPM perl modules with Strawberry perl on Windows?

Can anyone shed light on why people would be making this comment? 任何人都可以阐明为什么人们会发表评论吗? I've seen several threads on stackoverflow ( like this one ) where people say this. 我在stackoverflow上看到了几个线程( 就像这个一样 ),人们会这样说。 It seems to me that PPMs are nothing more than pre-compiled versions of modules that are just getting dropped into your perl installation. 在我看来,PPM只不过是刚刚进入perl安装的模块的预编译版本。 Assuming they have no external dependencies to a system DLL, what's the big risk? 假设它们与系统DLL没有外部依赖关系,那么最大的风险是什么?

As far as I can tell PPM does dependency checking when you install a particular module and will install any others that it requires. 据我所知,PPM在安装特定模块时会进行依赖性检查,并会安装其所需的任何其他模块。 Seems like the same thing as using .deb or .rpm files on a Linux distro. 看起来就像在Linux发行版上使用.deb或.rpm文件一样。

EDIT #1: 编辑#1:

I found this page regarding the module Wx where they're showing how to use PPM to install Wx for Strawberry Perl. 我找到了关于模块Wx的这个页面 ,他们展示了如何使用PPM为Strawberry Perl安装Wx。 I tried them and they seem to work just fine. 我尝试了它们,它们似乎工作得很好。 I also mixed CPAN modules using PPM and cpanminus, and everything seems fine. 我还使用PPM和cpanminus混合了CPAN模块,一切看起来都很好。 Modules such as: 模块如:

  • Wx WX
  • DateTime 约会时间
  • DBI DBI
  • Data::Dumper 数据::自卸车
  • DBD::AnyData DBD :: ANYDATA

I'm concluding that the comments regarding the risk of mixing PPM with Strawberry Perl as something that should be taken with a grain of salt, as something that may cause you an issue here or there, but in general its perfectly fine to use PPM modules with Strawberry Perl. 我得出的结论是关于将PPM与草莓Perl混合的风险的评论应该与一些盐一起使用,这可能会导致你在这里或那里出现问题,但总的来说使用PPM模块非常好用草莓Perl。

PPMs were created (by ActiveState, I think) so that users could install modules with XS extensions or which used external libraries, without needing to have a C compiler or make, or any of the unixy stuff that cpan expects to have present. 我认为PPM是由ActiveState创建的,因此用户可以安装具有XS扩展的模块或使用外部库,而无需使用C编译器或make,或者cpan期望存在的任何unixy内容。 One of their problems is that ActiveState (or someone) has to have made the PPM for the module you want, and all the modules it uses from CPAN. 他们的一个问题是ActiveState(或某人)必须为您想要的模块以及它从CPAN使用的所有模块制作PPM。 Sometimes this meant using an older version until they caught up, and sometimes it meant modules just weren't available. 有时这意味着使用旧版本,直到它们赶上,有时它意味着模块不可用。

The genius of Strawberry is that it provides a hidden unixy environment that cpan can use to build modules for you, so doing away with the need to package binaries. Strawberry的天才之处在于它提供了一个隐藏的unixy环境,cpan可以用它为你构建模块,因此不需要打包二进制文件。

This means you get the dependency checking done by cpan, and it becomes much easier (for certain values of easy) to install newer versions of modules, or to link to libraries in odd places, and for many more CPAN modules to be available without any effort from anyone. 这意味着你可以通过cpan完成依赖性检查,并且变得更容易(对于某些简单的值)安装较新版本的模块,或链接到奇数位置的库,以及更多CPAN模块可用而无需任何任何人的努力。

The same arguments can be made about using a linux-distro packaging system. 关于使用linux-distro打包系统,可以提出相同的论点。 If you need a module version that's out of sync with the distro then you're stuck. 如果您需要一个与发行版不同步的模块版本,那么您就会被卡住。 If you want to use a more up to date Perl, you're stuck. 如果你想使用更新的Perl,你就会陷入困境。 Perl has its own very good packaging system in the CPAN ecosystem, so it really makes sense to use that if you can. Perl在CPAN生态系统中有自己非常好的包装系统,所以如果可以的话,使用它真的很有意义。

At the same time, sometimes it's more sensible to use a set of provided binary packages, especially if you have to roll out lots of systems, and your Perl install is only a small part of the collection of packages you need to keep track of. 同时,有时候使用一组提供的二进制包更为明智,特别是如果你需要推出大量系统,而你的Perl安装只是你需要跟踪的软件包集合的一小部分。

PPDs can actually include external libraries (eg XML::LibXML's package includes libxml2), so they can be simpler to install. PPD实际上可以包含外部库(例如XML :: LibXML的包包含libxml2),因此它们可以更简单地安装。

PPDs are already compiled, so they can be faster to install. PPD已经编译好,因此可以更快地安装。

PPDs give you less control since they are prepared by someone else. 由于PPD由其他人准备,因此对您的控制较少。 You are limited to the modules available (which is thankfully a huge swath of what's available) and to the versions available. 您仅限于可用的模块(幸运的是,可用的大量内容)以及可用的版本。

I normally hesitate to mix two systems, but I have never encountered a single issue from using both ppm and cpan on the same build. 我通常会犹豫是否混合使用两个系统,但我从未遇到过在同一版本中同时使用ppmcpan问题。

Just use the one that's convenient for you. 只需使用方便的那个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM