You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 18.04安装Perl模块Data::Match遇"Can't use an array as a reference"错误的解决方法

解决Ubuntu 18.04下Perl模块Data::Match安装测试失败的问题

我在Ubuntu 18.04系统中尝试安装Perl模块Data::Match时遇到了测试环节失败的问题,试过常规安装方法都没解决,最终找到可行方案,分享给大家:

问题重现

我一开始遵循Perl模块的常规安装流程执行:

  • perl Makefile.pl
  • make
  • make test

但执行make test时触发了编译错误,具体报错信息如下:

make test PERL_DL_NONLAZY=1 "/usr/bin/perl" "-Iblib/lib" "-Iblib/arch" test.pl
1..1

Running under perl version 5.026001 for linux
Current time local: Wed Jun 29 18:41:13 2022
Current time GMT: Wed Jun 29 15:41:13 2022
Using Test.pm version 1.30

Can't use an array as a reference at blib/lib/Data/Match.pm line 968.
Compilation failed in require at test.pl line 10.
BEGIN failed--compilation aborted at test.pl line 10.
Makefile:825: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255

我此前安装其他Perl模块都能正常运行,也尝试过通过perl -MCPAN -e shell进入CPAN shell安装,但问题依然存在。

最终解决方法

通过强制跳过测试环节的命令,成功完成了模块安装:

sudo cpanm Data::Match --force

执行该命令后,模块被直接安装,后续可以正常调用使用。

内容的提问来源于stack exchange,提问作者Roni Weiss

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 01:02:34