develooper Front page | perl.perl5.porters | Postings from May 2012

CPAN / new Perl 5 features / Perl upgrade conundrum

Thread Next
Elizabeth Mattijsen
May 29, 2012 02:04
CPAN / new Perl 5 features / Perl upgrade conundrum
Message ID:
In the past years, Perl 5 has seen a lot of new features added to the language.  Some of these features I've been dying to be able to use in my CPAN modules.  But alas, if I use these new features, my modules don't run on older versions of Perl anymore.

This is holding back the use of new features in CPAN modules.  But it is also removing reasons for people to upgrade existing Perl installations: why would you want to upgrade, if there is no incentive to upgrade (especially in the light that CPAN is considered to be one of the Unique Selling Points of Perl).

As an author, I could envision that I maintain a "maint" version of my module (which would essentially be frozen, but for bugfixes), and a "blead" version of my module that would use new features of Perl and which would have new features added.  In other words, provide an incentive to upgrade an existing Perl installation.

Unfortunately, CPAN/cpan is not able to handle multiple versions of the same module very well.  So making a "maint" distribution of a module, and a "blead" distribution of a module, is out of the question.  So if I want to maintain a "maint" version and a "blead" version of my modules, they would need to live inside the same distribution.

After a few days of testing with one of my modules (Thread::Queue::Any), I think I created a system in which:

1. depending on perl version that runs the Makefile.PL, selects either the "maint" or "blead" version of the code.  Then tests and install that version of the code.

2. allows override of the version selection of the code, to allow 'maint' version of code to be installed on newer perls if needed (with "perl Makefile.PL maint").

3. has different version numbers for "maint" (0.13) and "blead" (1.04) version of the code.  So that it is easier to track problems in the wild.

4. shows up in searches in with both versions (I consider that a bonus, as the documentation of each version clearly states about which version it is).

5. shows up on MetaCPAN with just the "blead" documentation.

I'm pretty happy with this situation: people upgrading Perl modules on a system with an older Perl, will not see any breakage (because they will continue using the "maint" code).  And if they upgrade their Perl, they will automatically get the "blead" version of the code, which will not cause any breakage then either.

I therefor plan to upgrade all of my modules on CPAN in the same manner in the coming months.  Unless someone convinces me this is a bad idea.

So my question to p5p is: is this a valid / good way forward?

Suggestions / Remarks / Opinions very welcome!

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About