首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >perl模块Class::HPLOO v0.23安装问题

perl模块Class::HPLOO v0.23安装问题
EN

Stack Overflow用户
提问于 2018-08-25 00:59:31
回答 2查看 828关注 0票数 0

我正在尝试安装Class::HPLOO perl模块,但遇到了问题。我使用的是perl版本5.28.0。我迫切需要帮助解决这个问题,从过去的几天我一直在尝试解决这个问题,但没有运气:

我尝试通过cpan进行安装,得到以下错误:

代码语言:javascript
复制
# Running under perl version 5.028000 for linux
# Current time local: Thu Aug 23 22:50:40 2018
# Current time GMT:   Fri Aug 24 02:50:40 2018
# Using Test.pm version 1.31
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/({ <-- HERE \s+)/ at blib/lib/Class/HPLOO.pm line 1072.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/(\S)( { <-- HERE ) (\S)/ at blib/lib/Class/HPLOO.pm line 1077.
not ok 1
# Failed test 1 in test.pl at line 9
#  test.pl line 9 is:   ok(!$@) ;
Undefined subroutine &Foo::new_call_BEGIN called at test/classtest.pm line 5.
make: *** [test_dynamic] Error 255

我已经从https://metacpan.org/pod/Class::HPLOO网站下载了模块,并尝试手动安装,但同样的问题。

代码语言:javascript
复制
# Running under perl version 5.028000 for linux
# Current time local: Fri Aug 24 12:42:24 2018
# Current time GMT:   Fri Aug 24 16:42:24 2018
# Using Test.pm version 1.31
not ok 1
# Failed test 1 in test.pl at line 9
#  test.pl line 9 is:   ok(!$@) ;
Can't locate object method "new" via package "Foo" at test.pl line 11.
make: *** [test_dynamic] Error 2

请帮助解决此问题。提前感谢!

EN

Stack Overflow用户

发布于 2018-08-25 01:29:57

CPAN testers matrix显示,在Perlv5.22或更高版本上构建此模块时遇到了问题。如果您能够在早期版本的Perl上使用和构建此模块,那么这是您的一个选择。

日志显示了您发现的相同问题:弃用的正则表达式构造,但这还不是致命错误,也不是构建失败的原因。

向下钻取并在调试器中使用Perlv5.24运行测试脚本,我看到下面这行

代码语言:javascript
复制
eval { require "test/classtest.pm" } ;

使用以下消息设置$@ (表示require调用失败):

代码语言:javascript
复制
  DB<1> p $@                                                                                                                                                   
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at test/classtest.pm line 5.
 at test/classtest.pm line 5.
        require test/classtest.pm called at test.pl line 8
        eval {...} called at test.pl line 8
Compilation failed in require at test.pl line 8.

所以我们可以看到这个包(最后一次更新是在2005年)使用了defined(@array)结构,这个结构已经被弃用了很长一段时间,并且已经被prohibited since v5.22.0了。

defined(@array)结构在lib/Class/HPLOO/Base.pmlib/Class/HPLOO.pm中使用了4次。您可以尝试自己修复它们并重新构建模块。

票数 4
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52008870

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档