windows 使用 Strawberry Perl 安装模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6643939/
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
Installing modules using Strawberry Perl
提问by ronssd
Until now I used ActiveState's ActivePerl, and used the ppm for installing modules.
到目前为止,我使用ActiveState的ActivePerl,并使用 ppm 来安装模块。
Last week I moved to Strawberry Perl, but I don't know how I should install modules using Strawberry Perl. What is some information on how module installation is done using Strawberry Perl or is there some link on how to install new modules?
上周我搬到了Strawberry Perl,但我不知道应该如何使用 Strawberry Perl 安装模块。关于如何使用 Strawberry Perl 完成模块安装的一些信息,或者是否有一些关于如何安装新模块的链接?
回答by Alexandr Ciornii
You can still use ppm
, but it is not recommended. Run CPAN clientfrom the Strawberry Perlor Strawberry Perl (64-bit), sub folder Tools, entry in the Start menu.
您仍然可以使用ppm
,但不推荐使用。从Strawberry Perl或Strawberry Perl (64-bit),子文件夹Tools,开始菜单中的条目运行CPAN 客户端。
Type install Module::Name
there.
键入install Module::Name
那里。
回答by Alex
As Alexandr says, you can use the CPAN client via the start menu. You can also install modules just as you would on Unix from the DOS window:
正如Alexandr 所说,您可以通过开始菜单使用 CPAN 客户端。您也可以像在 Unix 上一样从 DOS 窗口安装模块:
perl -MCPAN -e shell
install Quantum::Entanglement
You can also download the .tar.gz from CPAN, unzip it and install as you would in Unix:
您也可以从 CPAN 下载 .tar.gz,解压并安装,就像在 Unix 中一样:
cd Module-Name-1.23
perl Makefile.PL
dmake
dmake test
dmake install
You may need to make sure your %PATH%environment variable has the right entry to get to Strawberry Perl, and does not contain other copies of dmake or gcc, which will sometimes lead to headaches.
您可能需要确保您的%PATH%环境变量具有访问 Strawberry Perl 的正确条目,并且不包含 dmake 或 gcc 的其他副本,这有时会导致头痛。
回答by James
Change the directory:
更改目录:
cd C:\Strawberry\perl\bin
Then
然后
C:\Strawberry\perl\bin>cpan Lingua::EN::Sentence
and the module will install automatically.
并且模块将自动安装。