gpt4 book ai didi

perl - 在 Windows 10 的 Active perl 中安装 Switch.pm

转载 作者:行者123 更新时间:2023-12-04 10:33:44 27 4
gpt4 key购买 nike

我正在尝试使用 Active Perl 5.28.1 在 Windows 10 上运行 Perl 脚本。它目前在带有 Active Perl 5.8.8 的 Windows 7 上运行。当我尝试运行它时,我得到:

Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: C:\Perl\lib C:/Perl64/site/lib C:/Perl64/lib) at fds_propagator_with_collision_ephem.pl line 108.

所以我尝试安装 Switch.pm。我启动了 cpan 然后 install Switch.pm

我得到了:

C:\Users\rdirosar>cpan
Loading internal logger. Log::Log4perl recommended for better logging

cpan shell -- CPAN exploration and modules installation (v2.20)
Enter 'h' for help.

cpan> install Switch.pm

Reading 'C:\Perl64\cpan\sources\authors\01mailrc.txt.gz'
Use of uninitialized value $command in concatenation (.) or string at C:\Perl64\lib/CPAN/Tarzip.pm line 163, <IN> line 1.

'-qdt' is not recognized as an internal or external command,
operable program or batch file.
............................................................................DONE

Reading 'C:\Perl64\cpan\sources\modules\02packages.details.txt.gz'
Use of uninitialized value $command in concatenation (.) or string at C:\Perl64\lib/CPAN/Tarzip.pm line 163.
'-qdt' is not recognized as an internal or external command,
operable program or batch file.

Warning: Your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
.Could not split line["┬0\cL²\cU\c?└'≈\cCé"]

Could not split line["c▐X'Γπ"├█\cP\cE?▀&δ┌╠5α%â╛mτl∞Bô⌠ñg▒R\cI¥\cT\cP╘≈\cX."]


Could not split line["V╟\c]\$≈»1"]

Could not split line["a\cVk\cQ0y│ôδNj+╒1<c;¼òPb╪Zà⌠∞\cBl≥┤h\cRU\cPFÄ┴▄4û\cIƒ\@⌐╜─b*QZ\$lEX╞╔■î>∩îÅ=\cF┬N;│¼-\cZu¿fÆh\eD"]

Giving up parsing your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz, too many errorsReading 'C:\Perl64\cpan\sources\authors\01mailrc.txt.gz'

Use of uninitialized value $command in concatenation (.) or string at C:\Perl64\lib/CPAN/Tarzip.pm line 163.


'-qdt' is not recognized as an internal or external command,
operable program or batch file.
............................................................................DONE

Reading 'C:\Perl64\cpan\sources\modules\02packages.details.txt.gz'

Use of uninitialized value $command in concatenation (.) or string at C:\Perl64\lib/CPAN/Tarzip.pm line 163.


'-qdt' is not recognized as an internal or external command,
operable program or batch file.

Warning: Your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz does not contain a Line-Count header.

Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to happen.

Warning: Your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz does not contain a Last-Updated header.

Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.

.Could not split line["┬0\cL²\cU\c?└'≈\cCé"]

Could not split line["c▐X'Γπ"├█\cP\cE?▀&δ┌╠5α%â╛mτl∞Bô⌠ñg▒R\cI¥\cT\cP╘≈\cX."]

Could not split line["V╟\c]\$≈»1"]

Could not split line["a\cVk\cQ0y│ôδNj+╒1<c;¼òPb╪Zà⌠∞\cBl≥┤h\cRU\cPFÄ┴▄4û\cIƒ\@⌐╜─b*QZ\$lEX╞╔■î>∩îÅ=\cF┬N;│¼-\cZu¿fÆh\eD"]

Giving up parsing your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz, too many errorsLockfile removed.

C:\Users\rdirosar>

我尝试删除以下文件:C:\Perl64\cpan\sources\authorsC:\Perl64\cpan\sources\modules\那没有效果,如果目录中有文件,它们将被更新根据需要。

我做错了什么?罗伯特

注意:我发现我需要在文本中添加一些 cr/lf,否则我会收到有关代码格式不正确的错误消息。

最佳答案

根据 https://www.activestate.com/blog/goodbye-ppm-hello-state-tool/ ActivePerl 5.28 删除了旧的 PPM 交互式 GUI 模块安装工具以支持新的 https://platform.activestate.com/您登录的网站,选择模块、构建、等待并最终将您自己的自定义运行时下载为一个大的 .exe 或 .msi 文件(无论如何在 Windows 上)。

此安装文件包括 ActivePerl 5.28 您选择的模块。

在我对 Windows 10 的测试中,Switch 模块的安装没有像这样的问题。

其他选择可能是:

  • 我认为 PPM a 仍然可用的 Perl 5.26,可在 activestate.com 找到它
  • 使用 5.28 中的 CPAN 命令,但对于许多(如果不是大多数)模块,您需要 makedmake。后者可能最容易通过 http://www.mingw.org/ 获得
  • 使用 WSL - windows subsystem for linux . aptyum 或适合您的 linux 风格的类似命令可用。安装 Perl 模块的简单可靠的方法。在我的经验中。但这不是 ActivePerl,几乎不是 Windows,主要是 Gnu/Linux
  • 适用于 Windows 的 Strawberry-Perl
  • Switch 似乎(现在快速浏览一下就可以判断)只是一个不依赖于其他非核心模块的纯 perl 模块。所以你可以从https://fastapi.metacpan.org/source/CHORNY/Switch-2.17/Switch.pm下载文件。并将其放在 perl -le'print for @INC' 输出的文件夹之一中,并确保系统用户可以读取该文件。

关于perl - 在 Windows 10 的 Active perl 中安装 Switch.pm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60289961/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com