<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> From: Fred Moyer <fred@redhotpenguin.com></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> To: Greg Lindahl <greg@blekko.com></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> Cc: sanfrancisco-pm@pm.org</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> Sent: Fri, March 4, 2011 12:33:32 PM</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> Subject: Re: [sf-perl] Dumb Q's about CPAN submission</font></div><div><font class="Apple-style-span" face="'times new roman', 'new
york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> On Fri, Mar 4, 2011 at 11:51 AM, Greg Lindahl <greg@blekko.com> wrote:</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> > I'm trying to submit my first CPAN modules and I have some dumb</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> > questions that I haven't found answers for.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> ></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> > 2) I have dependencies with YAML and Test::More -- the one other</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> > system I tried had an older version
of Test::More which doesn't</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> > grok 'done_testing()'.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> ></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> > How do I figure out which versions to ask for? Or should I just avoid</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> > done_testing() in cpan modules, so as to tolerate older versions?</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> With regards to running the tests based on the version of Test::More</font></div><div><font class="Apple-style-span" face="'times
new roman', 'new york', times, serif">> (if I'm understanding your question correctly), I usually use</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> something like this in the Makefile.PL to see if the needed version of</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> Test::More is installed. If it isn't, the tests don't run.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> package MY;</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> sub test {</font></div><div><font class="Apple-style-span" face="'times new
roman', 'new york', times, serif">> my $self = shift;</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> eval { require Test::More } or return <<EOF;</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> test::</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> \t\@echo sorry, cannot run tests without Test::More</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> EOF</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> unless
($Test::More::VERSION > '0.123') {</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> return <<EOF;</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> test::</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> \t\@echo sorry, need at least version 0.124 of Test::More</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> EOF</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> return $self->SUPER::test(@_);</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> }</font></div><div><font
class="Apple-style-span" face="'times new roman', 'new york', times, serif">> _______________________________________________</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> SanFrancisco-pm mailing list</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> SanFrancisco-pm@pm.org</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span>> <a target="_blank" href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> I'm trying to submit my first CPAN modules and I have some dumb</font></div><div><font class="Apple-style-span"
face="'times new roman', 'new york', times, serif">> questions that I haven't found answers for.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span>I'm sure you saw this, <a target="_blank" href="http://www.cpan.org/modules/04pause.html">http://www.cpan.org/modules/04pause.html</a></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">>1) I think the process should be:</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">></font></div><div><font class="Apple-style-span" face="'times new
roman', 'new york', times, serif">>* submit a test version (how do I indicate that? $VERSION = '1.00_1' ?)</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">>* cpan smokers send me emails showing breakage</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">>* fix bugs, rinse repeat, when done, use $VERSION = '1.00' to release</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> Correct?</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">Yes, more or less. </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york',
times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">Here is an interesting read on versioning in perl,</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span><a target="_blank" href="http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/">http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/</a></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> 2) I have dependencies with YAML and Test::More -- the one other</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> system I tried had an older version of Test::More which doesn't</font></div><div><font class="Apple-style-span" face="'times new
roman', 'new york', times, serif">> grok 'done_testing()'.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> How do I figure out which versions to ask for? Or should I just avoid</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">> done_testing() in cpan modules, so as to tolerate older versions?</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">Well, you should require a version with appropriate functionality.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new
york', times, serif">If you want to support older versions, don't use newer features.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">(or you can implement 'fallback to' on missing methods)</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">As for specifying specific versions, I like using MakeMaker.</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span><a target="_blank" href="http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.56/lib/ExtUtils/MakeMaker.pm#Using_Attributes_and_Parameters">http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.56/lib/ExtUtils/MakeMaker.pm#Using_Attributes_and_Parameters</a></span></font></div><div><span class="Apple-style-span" style="font-family: 'times new roman',
'new york', times, serif; ">see PREREQ_PM</span></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; color: black; "><br></div></div><div style="position: fixed; color: black; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "></div>
</div></body></html>