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

david wright david_v_wright at yahoo.com
Fri Mar 4 13:36:20 PST 2011


> From: Fred Moyer <fred at redhotpenguin.com>
> To: Greg Lindahl <greg at blekko.com>
> Cc: sanfrancisco-pm at pm.org
> Sent: Fri, March 4, 2011 12:33:32 PM
> Subject: Re: [sf-perl] Dumb Q's about CPAN submission
> 
> 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(@_);
> }
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

> I'm trying to submit my first CPAN modules and I have some dumb
> questions that I haven't found answers for.

I'm sure you saw this, http://www.cpan.org/modules/04pause.html


>1) I think the process should be:
>
>* submit a test version (how do I indicate that? $VERSION = '1.00_1' ?)
>* cpan smokers send me emails showing breakage
>* fix bugs, rinse repeat, when done, use $VERSION = '1.00' to release

> Correct?

Yes, more or less. 

Here is an interesting read on versioning in perl,
http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/

> 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?

Well, you should require a version with appropriate functionality.

If you want to support older versions, don't use newer features.
(or you can implement 'fallback to' on missing methods)

As for specifying specific versions, I like using MakeMaker.
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.56/lib/ExtUtils/MakeMaker.pm#Using_Attributes_and_Parameters

see PREREQ_PM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20110304/44375d8d/attachment.html>


More information about the SanFrancisco-pm mailing list