我应该为 Windows 选择 ActivePerl 还是 Strawberry Perl?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3365518/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Should I choose ActivePerl or Strawberry Perl for Windows?
提问by Andrew Андрей Листочкин
I'm totally new to Perl, but I'd like to try it out. I read about two rival distributions available for Windows platform (I guess there's justPerl on other OSes :).
我对 Perl 完全陌生,但我想尝试一下。我读到了两个可用于 Windows 平台的竞争发行版(我猜其他操作系统上只有Perl :)。
Wikipediasays that Strawberry Perlcomes with additional development tools to compile CPAN modules if necessary. It sounds pretty good to me.
维基百科说,如果需要,Strawberry Perl附带了额外的开发工具来编译 CPAN 模块。这对我来说听起来不错。
It also says that ActivePerlhas a lot of prepackaged modules which are easier to install with PPM. It sounds great too!
它还说ActivePerl有很多预打包的模块,这些模块更容易与 PPM 一起安装。听起来也很棒!
There's a clear trade-off between those two. And I wonder: What should I pick to get started? If I pick one how hard, is it to migrate to the other?
这两者之间存在明显的权衡。我想知道:我应该选择什么来开始?如果我选择一个有多难,是否要迁移到另一个?
I gave both distributions a run for a couple of weeks. I actually liked both which is a good thing! One can't go wrong with either of these.I ended up going with ActivePerl simply because it comes with offline documentation(in HTML)- a great life-savior for those who are on the road or just not always connected. It was super-easy for me to get started with Perl language while I was on vacation when I wasn't always online.
我让这两个发行版都运行了几个星期。我实际上两个都喜欢,这是一件好事!任何一个都不会出错。我最终选择了 ActivePerl,因为它带有脱机文档(HTML 格式)——对于那些在路上或只是不总是连接的人来说,这是一个很好的救星。当我不总是在线时,在度假时开始使用 Perl 语言对我来说非常容易。
Strawberry Perl is at least as great if not greater. So I can totally recommend it, too. And I have to say one should just learn Perl - it's a very beautiful language. Give it a try!
Strawberry Perl 如果不是更大的话,至少也同样出色。所以我也完全可以推荐它。我不得不说,人们应该只学习 Perl——它是一种非常优美的语言。试一试!
采纳答案by rubber boots
After having used both for years, I'd say, for me at least, ActivePerl is a much more convenient choice. The PPM installerincluded in ActivePerl allows you to add alternative PPM repositorieswhich will give you access to almost all useful Perl modules available on CPAN - but prepared and tested for Windows. This was for me, in the long run, a much better (and more robust) choice. Even for the Windows version of the Apache HTTP server, there is a precompiled mod_perl (2.0.4) ppm available which will (did for me) work out of the box with ActivePerl 5.12.1 and Apache 2.2.15.
在使用这两者多年之后,我想说,至少对我来说,ActivePerl 是一个更方便的选择。ActivePerl 中包含的PPM 安装程序允许您添加替代 PPM 存储库,这将使您可以访问 CPAN 上可用的几乎所有有用的 Perl 模块 - 但为 Windows 准备和测试。从长远来看,这对我来说是一个更好(也更强大)的选择。即使对于 Windows 版本的 Apache HTTP 服务器,也有一个预编译的 mod_perl (2.0.4) ppm 可用,它将(对我而言)与 ActivePerl 5. 12.1 和Apache 2.2.15一起开箱即用。
I think I dropped Strawberry Perl after trying to install DBI + DBD::mysql on Windows 7 (which is a no brainerin ActivePerl; just click on the ppms and choose install).
我想我掉了草莓的Perl试图安装DBI + DBD ::在Windows 7上的MySQL后(这是没有道理的了ActivePerl;只需点击PPMS并选择安装)。
But maybe that's solved by now. And maybe one can choose the directory where Strawberry Perl gets installed (I couldn't).
但也许现在已经解决了。也许人们可以选择安装 Strawberry Perl 的目录(我不能)。
BTW: for compiling your own Inline or XS stuff, just install the MinGW compiler by ppm(I didn't do that, but it looks interesting).
顺便说一句:要编译您自己的内联或 XS 内容,只需通过 ppm 安装 MinGW 编译器(我没有这样做,但看起来很有趣)。
Addendum: after reading the comment below, I checked Strawberry Perl again and it's now possible to change the installation directory, which is a denoted feature of the 5.12.0 release (which is the actual version). This would solve one important (IMHO) disadvantage of Strawberry Perl (compared to ActivePerl).
附录:在阅读下面的评论后,我再次检查了 Strawberry Perl,现在可以更改安装目录,这是 5.12.0 版本(这是实际版本)的一个特性。这将解决 Strawberry Perl(与 ActivePerl 相比)的一个重要(恕我直言)缺点。
回答by Vivin Paliath
Strawberry Perl uses CPAN, which means that you are up to date as far as modules are concerned. When things are added to CPAN, you have immediate access to them. Strawberry Perl also comes with MinGW which means that Strawberry Perl can use quite a few XS modules directly from CPAN without any modification. The MinGW distribution comes with gcc
, make
, ld
and other tools to help you build modules. I think Strawberry Perl also comes with a few modules that let you install PPMs (Perl Package Manager files).
Strawberry Perl 使用 CPAN,这意味着就模块而言,您是最新的。当事物添加到 CPAN 时,您可以立即访问它们。Strawberry Perl 还带有 MinGW,这意味着 Strawberry Perl 可以直接从 CPAN 使用相当多的 XS 模块,无需任何修改。MinGW的分布自带gcc
,make
,ld
和其他工具,以帮助您构建模块。我认为 Strawberry Perl 还带有一些模块,可以让您安装 PPM(Perl 包管理器文件)。
ActivePerl installs modules using its own format called PPM (Perl Package Manager). The official repository is hosted by ActiveState. You can find PPMs for most of the popular modules so you shouldn't have any trouble unless you are looking for an obscure or really new package (so bleeding-edge stuff won't work because PPM usually lags behind CPAN). Although easier to install than CPAN modules, PPMs are specifically created for Windows and so some CPAN modules will not work (because they do Unix-specific things).
ActivePerl 使用自己的称为 PPM(Perl 包管理器)的格式安装模块。官方存储库由 ActiveState 托管。您可以找到大多数流行模块的 PPM,因此您应该不会遇到任何麻烦,除非您正在寻找一个不起眼的或真正新的软件包(因此前沿的东西将不起作用,因为 PPM 通常落后于 CPAN)。尽管比 CPAN 模块更容易安装,但 PPM 是专门为 Windows 创建的,因此某些 CPAN 模块将无法工作(因为它们执行 Unix 特定的操作)。
I have used both before and it seemed to work for most cases. But I lean towards Strawberry Perl because the environment is closer to Unix and so there are not many incompatibilities. On the other hand, ActivePerl is made for Windows and so it works with Windows very well.
我之前都用过,它似乎适用于大多数情况。但是我更倾向于 Strawberry Perl,因为它的环境更接近 Unix,所以没有太多不兼容的地方。另一方面,ActivePerl 是为 Windows 设计的,因此它可以很好地与 Windows 配合使用。
Another option is to install Cygwin and Perl that comes with Cygwin. I have done that before and it works reasonably well. You also get access to CPAN.
另一种选择是安装 Cygwin 附带的 Cygwin 和 Perl。我以前这样做过,而且效果还不错。您还可以访问 CPAN。
Pick what you think works best for you.
选择您认为最适合您的方式。
回答by hobbs
Amplifying just a tiny bit on Vivin Paliath's helpful answer:
稍微放大 Vivin Paliath 的有用回答:
ActivePerl / PPM pros: If there's a PPM for your version, it's going to work, and simply.
ActivePerl / PPM 优点:如果您的版本有 PPM,它就会起作用,而且很简单。
ActivePerl / PPM cons: There's not always a PPM, or at least not always an up-to-date one.
ActivePerl / PPM 缺点: 不总是有 PPM,或者至少不总是最新的。
Strawberry Perl / CPAN pros: Your repository is CPAN, not a bunch of binaries maintained by third parties. You have new modules the moment the author releases them, and you're using the build system that the author intended.
Strawberry Perl / CPAN 优点:您的存储库是 CPAN,而不是一堆由第三方维护的二进制文件。在作者发布新模块的那一刻,您就有了新模块,并且您正在使用作者想要的构建系统。
Strawberry Perl / CPAN cons: Not everything is guaranteed to build perfectly with the Windows tools.
Strawberry Perl / CPAN 缺点:并非所有东西都可以保证使用 Windows 工具完美构建。
Strawberry Perl / CPAN mitigating factor: The Strawberry developers try really, really hardto make sure that everything goes smoothly and that as much of CPAN as possible is available to you, and when modules are identified as trouble spots (difficult to build on Windows, but required for other popular modules/applications), they'll either work with the author to get the module fixed so that everyone caninstall it, or in exceptional cases, apply their own fixups and bundle the module with Strawberry Perl or Strawberry Perl Professional.
Strawberry Perl / CPAN 缓解因素:Strawberry 开发人员非常非常努力地尝试确保一切顺利进行,并且尽可能多的 CPAN 可供您使用,并且当模块被识别为故障点时(难以在 Windows 上构建,但其他流行的模块/应用程序需要),他们将与作者合作修复模块以便每个人都可以安装它,或者在特殊情况下,应用他们自己的修复并将模块与 Strawberry Perl 或 Strawberry Perl Professional 捆绑在一起.
My preference is with Strawberry Perl. I appreciate what ActivePerl is trying to do, but I think it's a bottleneck in the development process. They were necessarybefore the community got together and built Strawberry Perl to bring Windows into the "first world" of the Perl ecosystem, but they're not necessary anymore.
我更喜欢用 Strawberry Perl。我很欣赏 ActivePerl 正在尝试做的事情,但我认为这是开发过程中的一个瓶颈。他们是必要的前社区聚集在一起,建立草莓的Perl带来的Windows到Perl的生态系统的“世界第一”,但他们没有必要了。
回答by Paul Nathan
Strawberry Perl is more Unixy in its approach, and I have been always very happy when I've worked with it.
Strawberry Perl 的方法更 Unixy,当我使用它时,我一直很高兴。
ActivePerl, however, due to its custom package management system, has been a colossal pain when I've worked with it. This matters when you're in an enterprise environment.
然而,ActivePerl 由于其定制的包管理系统,当我使用它时一直是一个巨大的痛苦。当您处于企业环境中时,这很重要。
For just messing around, IMO, Strawberry Perl is better. /subjective
对于只是乱搞,IMO,Strawberry Perl 更好。/主观
回答by Francisco Zarabozo
Both are great and work the same. Strawberry Perl is known for being able to build XS modules, but you can do that with ActivePerl too if you just install the Visual Studio SDK (or the free Express version).
两者都很棒并且工作相同。Strawberry Perl 以能够构建 XS 模块而闻名,但如果您只安装 Visual Studio SDK(或免费的 Express 版本),您也可以使用 ActivePerl 来做到这一点。
For that matter, if you have access to Visual Studio, the best you can do is to build Perl from source (it's pretty easy if you read the README) and keep building your modules with the same compiler. That's actually a better idea than having a mixture of compiler/modules.
就此而言,如果您可以访问 Visual Studio,那么您能做的最好的事情就是从源代码构建 Perl(如果您阅读自述文件很容易)并继续使用相同的编译器构建您的模块。这实际上比混合使用编译器/模块更好。
One thing you have to consider if using ActiveState:If you install it on a server facing the Internet, then you are required to buy a Business license ($1000/year/server as noted by Ron Warshawsky). It doesn't mean it won't work; it's only a matter of being a requirement in the EULA. Many people don't know this and have it installed on Internet-facing servers without buying the corresponding license.
如果使用 ActiveState,您必须考虑的一件事是:如果您将其安装在面向 Internet 的服务器上,那么您需要购买商业许可证(Ron Warshawsky 指出的每台服务器 1000 美元/年)。这并不意味着它不会起作用;这只是 EULA 中的一项要求。许多人不知道这一点,并在没有购买相应许可证的情况下将其安装在面向 Internet 的服务器上。
回答by MkV
In a perfect world, I'd choose debian-interixor pkgsrc-interixPerl (not the ancient Perl that ships with Interix/SFU/SUA) since it provides the most POSIX / UNIX -like system (including real copy-on-write fork, not Windows fork emulation from Cygwin).
在一个完美的世界中,我会选择debian-interix或pkgsrc-interixPerl(不是 Interix/SFU/SUA 附带的古老 Perl),因为它提供了最 POSIX/UNIX 类系统(包括真正的 copy-on-write叉,而不是来自 Cygwin 的 Windows 叉仿真)。
I have in the past (and it is installed on Windows machines here), but not everyone can / will install SFU/SUA just for Perl. In those cases I'd recommend ActivePerl, primarily for the interface's familiarity to Windows users (PPM graphical shell versus CPAN) and its integration with the Perl Dev Kit (PerlExe, PerlNET, PerlSvc, and friends).
我过去有过(这里安装在 Windows 机器上),但不是每个人都可以/会为 Perl 安装 SFU/SUA。在这些情况下,我推荐 ActivePerl,主要是因为 Windows 用户熟悉该界面(PPM 图形外壳与 CPAN)以及它与 Perl Dev Kit(PerlExe、PerlNET、PerlSvc 和朋友)的集成。
Also, contrary to what others have answered, you can use CPAN (and the CPAN shell) with ActivePerl (though it does involve installing the necessary development tools via PPM first) if you need it.
此外,与其他人的回答相反,如果需要,您可以将 CPAN(和 CPAN shell)与 ActivePerl 一起使用(尽管它确实涉及首先通过 PPM 安装必要的开发工具)。
回答by Ron Warshawsky
ActivePerl excludes tons of modules from Community edition and building them under Windows is a real pain.
ActivePerl 从社区版中排除了大量模块,在 Windows 下构建它们是一个真正的痛苦。
Also, they would let you download and use only latest editions for free. Everything else, like access to 5.8.8 or to earlier version of modules is either Business ($1000/year/server) or Enterprise edition (per quote).
此外,他们会让您免费下载和使用最新版本。其他一切,如访问 5.8.8 或更早版本的模块,要么是商业版(1000 美元/年/服务器),要么是企业版(每报价)。
回答by Steve Lloyd
If Larry Wall uses Strawberry Perl so should you. ;)
如果 Larry Wall 使用 Strawberry Perl,那么您也应该使用。;)
回答by Kevin Coombes
If you are using the box.com client to sync files, then you probably want (at least at the moment) to go with Strawberry Perl. The ppm
executable conflicts with one of the Box.com DLL files. The GUI will not start at all (yielding a Windows message that the "perl ... interpreter has stopped working".) I have also had intermittent problems using the command line version of ppm when the Box.com client is installed.
如果您使用 box.com 客户端来同步文件,那么您可能想要(至少目前)使用 Strawberry Perl。该ppm
可执行文件的冲突与Box.com DLL文件之一。GUI 根本不会启动(产生一条 Windows 消息“perl ...解释器已停止工作”。)在安装 Box.com 客户端时,我在使用 ppm 的命令行版本时也遇到了间歇性问题。
回答by Charles
If you design your application right, it shouldn't matter which you choose.
如果您正确设计了应用程序,那么您选择哪个都无关紧要。
A big point might be the versions of various modules that each can provide, or not provide. PPM packages can lag behind CPAN releases, but if you aren't careful, bleeding-edge CPAN releases can break backwards compatibility. Furthermore, sometimes there will be PPM packages for things that just won't build properly under Strawberry Perl (though this implies that the module is poorly designed more often than not).
一个重要的点可能是每个模块可以提供或不提供的各种模块的版本。PPM 包可能落后于 CPAN 版本,但如果您不小心,前沿的 CPAN 版本可能会破坏向后兼容性。此外,有时会有 PPM 包用于在 Strawberry Perl 下无法正确构建的东西(尽管这意味着该模块通常设计得很差)。
Just be aware of the versions of any modules you use, and you should be fine, regardless of which you choose.
请注意您使用的任何模块的版本,无论您选择哪个,都应该没问题。