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

I thought when creating a new module intended for publishing on CPAN why not using a best practice boilerplate to get it right.

Some searching in the archives recommended ExtUtils::ModuleMaker and Module::Maker both also available with PerlBestPractices sub-modules.

First of all the created files where not as correct as expected, though I was asked for an "abstract" it wasn't included into the module. Well this could be done manually, I could spend another time searching the problem.

BUT to my huge surprise the first testrun on a virgin module failed

# Failed test "Pod coverage on Macro" # at /usr/local/share/perl/5.10.0/Test/Pod/Coverage.pm line 126. # Macro: couldn't find pod # Looks like you failed 1 test of 1.

Couldn't find POD? This file had no subs but already plenty of POD...

After hours of debugging, playing with the POD and patching Test::Pod::Coverage it turned out that the test wasn't able to find and require my module. (thanks for this brilliant error message, Andy!)

The test looked like this

#!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD co +verage" if $@; all_pod_coverage_ok();

and the "-T" taint disabled the inclusion of PERL5LIB into @INC. In other words I couldn't point perl to use modules from my development directory.

ATM I left the "-T" out, but I could also extend the test to push "../lib" to @INC.

questions:

  • whats the recommended approach for testing?

  • should I use another approach than setting PERL5LIB?

  • shouldn't a fracking boilerplate test already cover such a case?

    Cheers Rolf

    ( addicted to the Perl Programming Language)

  • Replies are listed 'Best First'.
    Re: ExtUtils::ModuleMaker::PBP and Test::Pod::Coverage problems
    by Anonymous Monk on Mar 18, 2014 at 07:28 UTC

      whats the recommended approach for testing? should I use another approach than setting PERL5LIB? shouldn't a fracking boilerplate test already cover such a case?

      I think "dont use taint" for author tests ought to cover all three

      In case it doesn't see Test::XT :)

        Thanks for pointing me to Test::XS. :)

        Cheers Rolf

        ( addicted to the Perl Programming Language)