缺少switch.pm - Active Perl x64/windows

Ale*_*nze 5 perl activeperl

我已经安装了Active Perl(v5.14.2,64位,适用于Windows),并且我的代码包含use Switch;错误导致失败Can't locate Switch.pm in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64/lib .) at myfilename.pl line 3..

switch.pm从较旧的32位安装复制修复了问题,但我不明白.switch.pm在此期间已被弃用?

Sin*_*nür 18

它被替换为给定/何时:

从Perl 5.10开始,你可以说

use feature "switch";
Run Code Online (Sandbox Code Playgroud)

这使得交换机功能非常基于Perl 6提案.

另请参见perl5101delta中的弃用:

现在不推荐使用以下项目.

Switch是错误的,应该避免.从perl 5.11.0开始,任何对该模块的核心版本的使用都将发出警告,并且该模块最终将从核心中移除(可能在perl 5.14.0中).

如果您有使用Switch.pm的旧代码,它仍可在CPAN上使用.


om9*_*om9 5

您可以使用以下命令在命令提示符下在Windows系统上安装"Switch"软件包: ppm install Switch