简体   繁体   English

使用草莓安装模块 Perl

[英]Installing modules using Strawberry Perl

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.上周我搬到了草莓 Perl ,但我不知道应该如何使用草莓 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 完成模块安装的一些信息,或者是否有一些关于如何安装新模块的链接?

You can still use ppm , but it is not recommended.您仍然可以使用ppm ,但不建议这样做。 Run CPAN client from the Strawberry Perl or Strawberry Perl (64-bit) , sub folder Tools , entry in the Start menu.Strawberry PerlStrawberry Perl (64-bit)运行CPAN 客户端,子文件夹Tools ,进入开始菜单。

Type install Module::Name there.在此处输入install Module::Name

As Alexandr says , you can use the CPAN client via the start menu.正如Alexandr 所说,您可以通过开始菜单使用 CPAN 客户端。 You can also install modules just as you would on Unix from the DOS window:您还可以像在 DOS window 中的 Unix 上一样安装模块:

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 的其他副本,这有时会导致头痛。

Change the directory:更改目录:

cd C:\Strawberry\perl\bin

Then然后

C:\Strawberry\perl\bin>cpan Lingua::EN::Sentence

and the module will install automatically.模块将自动安装。

CPAN is the easiest installation method. CPAN 是最简单的安装方法。

As Alex has noted , you may have to download a.tar.gz and unzip it.正如Alex 所指出的,您可能需要下载 a.tar.gz 并解压缩。 Since he wrote his answer, Strawberry Perl has deprecated dmake , and you should use gmake instead.自从他写了答案以来, Strawberry Perl 已弃用dmake ,您应该改用gmake

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

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