问题:

perl v5.26.1运行含有智能匹配符的源代码,提示如下报错

Smartmatch is experimental at test.pl line 1.

解决方案1:

在源代码的开头添加如下语句

no warnings 'experimental::smartmatch';

解决方案2:

使用experimental模块

#use experimental 'smartmatch';

问题出现的原因:

智能匹配操作符存在bug, 需要谨慎使用,新版本自动警告,降低版本或者添加上述语句。

相关文章:

  • 2022-01-03
  • 2021-11-16
  • 2021-11-20
  • 2021-12-27
  • 2022-01-08
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
猜你喜欢
  • 2021-11-05
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
相关资源
相似解决方案