Paul,

I had downloaded the Devel::Cover module form the
URL http://search.cpan.org/author/PJCJ/Devel-Cover-0.20/ and trying to get the
coverage for a program. I had installed the Devel::Cover module and here is what
I had done:

* I am using the perl version 5.8.0 .

The command I had given is :

perl -MDevel::Cover=-db,program_1,-coverage,statement,time program_1.pl

The file program_1.pl contains:
=================================
#!/usr/local/bin/perl

print "Hello World\n";

=================================

The above command creates a directory and by name program_1 and creates a file
by name cover.4 in it.

Now when I run the command :

cover program_1 -report text

I get the following output :

Reading database from program_1


-------------------------------------------------------- ------ ------ ------
File                                                       stmt   time  total
-------------------------------------------------------- ------ ------ ------
program_1.pl                                               0.00    n/a   0.00
Total                                                      0.00    n/a   0.00
-------------------------------------------------------- ------ ------ ------


program_1.pl

line  err   stmt   time   code
1                         #!/usr/local/bin/perl
2
3     ***      0          print "Hello World\n";
4

Paul, I am not able to understand why is it showing the coverage as 0.

Thanks and Regards,
Rajanikanth


Paul Johnson wrote:

> Rajanikanth Dandamudi said:
> > Hai
> >
> > I am planning to get the coverage of a file by name program_1.pl . This
> > program_1.pl dynamically loads a c module defined in program_1.so . This
> > program_1.so is a 64 bit ELF shared library and the perl available in
> > the standard location is a 32-bit perl.
> >
> > So I had downloaded the perl v5.8.0 from cpan and compiled to obtain
> > 64-bit perl. The module Devel/Coverage.pm which I generally use for
> > obtaining coverage is not part of the perl distribution. Hence I
> > downloaded the package(Devel-Coverage-0.2.tar.gz) and installed the
> > Devel/Coverage.pm module.
> >
> > Now when I run the following command to obtain the coverage :
> >
> > perl -d:Coverage program_1.pl
> >
> > I get the following error message:
> >
> > No DB::DB routine defined at
> > /proj/dite/WorkArea/Raja/perl/install/lib/site_perl/5.8.0/Devel/Coverage.pm
> > line 4.
> > BEGIN failed--compilation aborted at
> > /proj/dite/WorkArea/Raja/perl/install/lib/site_perl/5.8.0/Devel/Coverage.pm
> > line 4.
> > Compilation failed in require.
> > BEGIN failed--compilation aborted.
> >
> >
> > Can someone helpme in understanding what the above problem is and how to
> > overcome this?
>
> This is a known problem.  Randy, the author, has said that he will provide
> an updated version when he can.  I think the solution involves declaring
> the DB::DB subroutine earlier, but I am not sure.  Your other options are
> to go back to 5.6.1, or to try Devel::Cover.
>
> Devel::Cover should work on a 64 bit perl, but feel free to send me
> feedback if you try it.
>
> --
> Paul Johnson - [EMAIL PROTECTED]
> http://www.pjcj.net


Reply via email to