我只想在perl文件中覆盖子程序。 所以在主文件中我插入了以下语句:
use Devel::Cover::Subroutine;
如果我运行mainfile.pl,则显示错误:
Devel::Cover: Writing coverage database to /home/devel1/Devel-Cover-0.78/examples1/cover_db/runs/1319109459.10082.56199
Can't find digest for mainfile.pl at /opt/perl_32/lib/site_perl/5.8.8/IA64.ARCHREV_0-thread-multi/Devel/Cover/DB/Structure.pm line 282.
Devel::Cover: Can't find digest for mainfile.pl
--------------------------------------------------------------- ------ ------
File sub total
--------------------------------------------------------------- ------ ------
Total n/a n/a
--------------------------------------------------------------- ------ ------
如何解决此错误?
但是,当我只使用use Devel::Cover;
时,它可以正常工作。
答案 0 :(得分:6)
Devel::Cover::Subroutine
是Devel :: Cover用来表示子程序覆盖率数据的内部模块。你不应该直接使用它。相反,您应该将Devel::Cover
与-subs_only
选项一起使用。