我是 Perl 新手,我正在尝试为我拥有的 Perl 脚本生成覆盖率报告。我按照此处提到的步骤安装 Devel-Cover https://code.activestate.com/ppm/Devel-Cover/并运行
perl -MDevel::Cover script
我得到了一些报道信息和那条消息
Pod coverage is unavailable. Please install Pod::Coverage from CPAN.
然后运行命令cover
来生成报告,我让cover: Command not found.
Tringcpan install Pod::Coverage
按照输出的说明运行,但它失败了。我不确定我在这里缺少什么。我也尝试使用 Devel::Coverage
perl -d:Coverage script
但我得到了那个输出
Can't locate Devel/Coverage.pm in @INC (you may need to install the Devel::Coverage module) (@INC contains: /spiratech/tools/perllib /home/mmaher/.cache/activestate/02540130/lib/perl5/site_perl/5.32.0/x86_64-linux /home/mmaher/.cache/activestate/02540130/lib/perl5/site_perl/5.32.0 /home/mmaher/.cache/activestate/02540130/lib/perl5/5.32.0/x86_64-linux /home/mmaher/.cache/activestate/02540130/lib/perl5/5.32.0).
BEGIN failed--compilation aborted.
%!s(<nil>)
而且我找不到任何有关如何安装它的说明。我正在使用 Perl v5.32.0