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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:34:37  来源:igfitidea点击:

Installing modules using Strawberry Perl

windowsperlcpanperl-modulestrawberry-perl

提问by ronssd

Until now I used ActiveState's ActivePerl, and used the ppm for installing modules.

到目前为止,我使用ActiveStateActivePerl,并使用 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 PerlStrawberry Perl (64-bit),子文件夹Tools,开始菜单中的条目运行CPAN 客户端

Type install Module::Namethere.

键入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.

并且模块将自动安装。

回答by Wes

CPAN is the easiest installation method.

CPAN 是最简单的安装方法。

As Alex has noted, you may have to download a .tar.gz and unzip it. Since he wrote his answer, Strawberry Perl has deprecated dmake, and you should use gmakeinstead.

正如Alex 所指出的,您可能需要下载 .tar.gz 并解压。自从他写下答案以来,Strawberry Perl 已弃用dmake,您应该改用gmake