在 XAMPP for Windows 上从 CPAN 安装 perl 模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7171138/
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-15 17:55:48  来源:igfitidea点击:

Installing a perl module from CPAN on XAMPP for Windows

windowsperlxamppcpan

提问by Brian

I'm pretty rusty with Perl and I don't think it's helping that I'm running it in Windows.

我对 Perl 非常生疏,我认为在 Windows 中运行它没有帮助。

I'd like to install thismodule. I tried the instructions hereto install a CPAN module, but it fails trying to install App::cpanminus (the very first step.) I tried just running cpan Config::Simpleand it didn't work either. In both situations, it fails with this error message:

我想安装这个模块。我尝试了此处的说明来安装 CPAN 模块,但尝试安装 App::cpanminus(第一步)失败。我尝试运行cpan Config::Simple,但也无法正常工作。在这两种情况下,它都会失败并显示以下错误消息:

Unwrapping had some problem, won't try again without force
  Had problems unarchiving. Please build manually
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install

Does CPAN just not work from the version of Perl that's installed with XAMPP? If so, how do I upgrade it without breaking anything?

CPAN 是否不能从随 XAMPP 安装的 Perl 版本运行?如果是这样,我如何在不破坏任何东西的情况下升级它?

回答by daxim

  1. manually download and unpack the distro archive
  2. change into the unpacked directory
  3. run cpanm .or cpan .
  1. 手动下载并解压发行版存档
  2. 进入解压目录
  3. 运行cpanm .cpan .

回答by Matthew Lock

XAMPP also ships with PPMin C:\xampp\perl\bin\ppm.bat which is often a more Windows friendly way to get modules for perl.

XAMPP 还在C:\xampp\perl\bin\ppm.bat 中附带了PPM,这通常是一种对 Windows 更友好的获取 perl 模块的方式。

There's a step by step example of using ppm with XAMPP here: http://www.apachefriends.org/f/viewtopic.php?t=26407

这里有一个使用 ppm 和 XAMPP 的分步示例:http: //www.apachefriends.org/f/viewtopic.php?t=26407

Many modules are already installed in C:\xampp\perl\lib and C:\xampp\perl\site\lib

许多模块已经安装在 C:\xampp\perl\lib 和 C:\xampp\perl\site\lib