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.plmakemake test
但执行make test时触发了编译错误,具体报错信息如下:
make test PERL_DL_NONLAZY=1 "/usr/bin/perl" "-Iblib/lib" "-Iblib/arch" test.pl
1..1Running under perl version 5.026001 for linuxCurrent time local: Wed Jun 29 18:41:13 2022Current time GMT: Wed Jun 29 15:41:13 2022Using Test.pm version 1.30Can'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
相关产品推荐
相关产品推荐

