[sf-perl] Dumb Q's about CPAN submission

Fred Moyer fred at redhotpenguin.com
Fri Mar 4 12:33:32 PST 2011


On Fri, Mar 4, 2011 at 11:51 AM, Greg Lindahl <greg at blekko.com> wrote:
> I'm trying to submit my first CPAN modules and I have some dumb
> questions that I haven't found answers for.
>
> 2) I have dependencies with YAML and Test::More -- the one other
> system I tried had an older version of Test::More which doesn't
> grok 'done_testing()'.
>
> How do I figure out which versions to ask for? Or should I just avoid
> done_testing() in cpan modules, so as to tolerate older versions?

With regards to running the tests based on the version of Test::More
(if I'm understanding your question correctly), I usually use
something like this in the Makefile.PL to see if the needed version of
Test::More is installed.  If it isn't, the tests don't run.

package MY;

sub test {
    my $self = shift;

    eval { require Test::More } or return <<EOF;
test::
\t\@echo sorry, cannot run tests without Test::More
EOF

    unless ($Test::More::VERSION > '0.123') {
        return <<EOF;
test::
\t\@echo sorry, need at least version 0.124 of Test::More
EOF

    return $self->SUPER::test(@_);
}


More information about the SanFrancisco-pm mailing list