在 Windows 中手动安装 Perl 模块
我曾多次尝试(未成功)手动安装 CPAN 中找到的 Perl 模块 (Win32-Printer-0.9.1),但未包含在 PPM 存储库中。据我所知,该模块必须下载并解压。我知道您必须运行包含的 MakeFile.pl。
我知道 nmake 以某种方式参与其中,但尽管尝试遵循网上找到的说明,但我一直无法让它工作。
我在 Windows 上使用 ActivePerl 5.12.2。
我真的不明白为什么会这么复杂!
I have tried (unsuccessfully) many times to manually install a Perl module (Win32-Printer-0.9.1) found in CPAN, but not included in the PPM repository. What I know is that the module must be downloaded and decompressed. I know you have to run the MakeFile.pl that is included.
And I know nmake is involved somehow, but despite trying to follow the directions found online, I've been unable to get it to work.
I'm using ActivePerl 5.12.2 on Windows.
I really can't figure out why this would be so complicated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在使用 ActivePerl。这很好,但如果您需要 PPM 中没有的东西,您就会陷入困境。查看 PPM 配置。默认情况下,它仅包含 ActiveState PPM 站点,但您也可以将其配置为使用其他存储库。检查“编辑”->“首选项”菜单。然后单击“存储库”选项卡。您还可以在 PPM 存储库列表中包含其他六个 PPM 存储库。将它们添加进去,看看你的 CPAN 模块是否在其中。
Windows 的另一个 Perl 选择是 Strawberry Perl。这包括一个 MinGW 发行版,它带有最低配置的
gcc
编译器和基础库。这允许您无需修改即可使用 CPAN 存档中的几乎所有模块。I take it you're using ActivePerl. It's nice, but if you need something that's not in PPM, you're sort of stuck. Take a look at the PPM configuration. By default, it only includes the ActiveState PPM site, but you can configure it to use other repositories too. Check under the Edit->Preference menu. Then click on the "Repositories" tab. There are six other PPM repositories you can include in your list of PPM repositories. Add them in, and see if your CPAN modules are in those.
The other Perl choice for Windows is Strawberry Perl. This includes a MinGW distribution that comes with a minimally configured
gcc
compiler and base libraries. That allows you to use almost any module in the CPAN archive without modification.运行命令框 (cmd.exe) 并输入“cpan Win32::Printer”,它应该会自动安装。
Run a command box (cmd.exe) and type 'cpan Win32::Printer' and it should install automatically.