gpt4 book ai didi

perl - 缺少 switch.pm - Active Perl x64/windows

转载 作者:行者123 更新时间:2023-12-04 16:22:21 30 4
gpt4 key购买 nike

我已经安装了 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在此期间被弃用?

最佳答案

它被替换为 given/when :

Starting from Perl 5.10, you can say

use feature "switch";

which enables a switch feature that is closely based on the Perl 6 proposal.


另见 Deprecations in perl5101delta :

The following items are now deprecated.

Switch is buggy and should be avoided. From perl 5.11.0 onwards, it is intended that any use of the core version of this module will emit a warning, and that the module will eventually be removed from the core (probably in perl 5.14.0).


如果您有使用 Switch.pm 的遗留代码,它仍然是 available on CPAN .

关于perl - 缺少 switch.pm - Active Perl x64/windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10360274/

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