crusader has asked for the wisdom of the Perl Monks concerning the following question:

i want only subroutine coverage in my perl file. so in main file i inserted the following statement

mainfile.pl

use Devel::Cover ( '-coverage' => 'subroutine', );

if i run mainfile.pl it shows the error as

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

--------------------------------------------------------------- ------ ------

how can i resolve this error ?

  • Comment on Devel::Cover - only subroutine coverage

Replies are listed 'Best First'.
Re: Devel::Cover - only subroutine coverage
by Khen1950fx (Canon) on Oct 24, 2011 at 05:04 UTC
    Starting from the cmdline, cd to the directory where you want the db. Then...
    perl -MDevel::Cover mainfile.pl
    Then run
    perl -MDevel::Cover=-coverage,subroutine mainfile.pl && cover -report text
    Does that help?