1

我只想在我的 perl 文件中覆盖子程序。所以在主文件中我插入了以下语句:

主文件.pl

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;它可以正常工作。

4

1 回答 1

6

Devel::Cover::Subroutine是 Devel::Cover 用来表示子程序覆盖数据的内部模块。你不应该直接使用它。相反,您应该使用Devel::Cover-subs_only选项。

于 2011-10-24T06:39:13.460 回答