Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Minimum Perl Version standard for CPAN?

by blue_cowdawg (Prior)
on Jan 23, 2013 at 20:56 UTC ( #1015022=perlquestion: print w/ replies, xml ) Need Help??
blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, Monkettes, and Monkees:
I have a family of Perl modules that I am cleaning up in preparation for publishing to CPAN. As I was proceeding I noticed in one of my modules

use feature 'switch';
which I had forgotten I was using. I have two questions:
  1. What version did this show up? (I forget)
  2. What version of Perl is considered "standard" for public consumption?
Not much sense in releasing a module nobody can use...


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Comment on Minimum Perl Version standard for CPAN?
Download Code
Re: Minimum Perl Version standard for CPAN?
by toolic (Chancellor) on Jan 23, 2013 at 21:09 UTC

      I don't think it's unreasonable to expect people to be using at least Perl 5.10.

      OK, so there are a bunch of legacy Perl 5.8 and even 5.6 installations out there, but these people shouldn't be expecting to be able to download brand new releases from CPAN.

      My own policy is to generally target 5.10, but if I can support 5.8 or earlier without too much extra trouble, then do so (especially on Tiny-style modules). A handful of my distributions even require Perl 5.12 or 5.14.

      package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
        There is no standard Perl version for Perl 5, unlike Perl 6 which started with a standard. As for me, I'm comfortable with any Perl version thrown at me:-).
Re: Minimum Perl Version standard for CPAN?
by davido (Archbishop) on Jan 23, 2013 at 23:14 UTC

    Moose and Moo support Perl 5.8, but not 5.6. And we frequently see questions from people stuck with 5.8 on RHEL (and apparently unable/unwilling/forbidden from installing a newer local Perl). But it's quite unusual to find a CPAN tester still smoking distributions on Perl's that precede 5.6. Perl's newest features are fantastic for in-house code, but I believe CPAN code ought to be more portable.

    I look at it this way; When I put something up on CPAN it's so that others might get some use out of something that I found to be useful. If I'm going to go to the effort of creating a distribution, I may as well do so for as broad a base as I can. Supporting older Perl versions is sort of like supporting a broad range of OS's. I cannot guess who will be using a module, what OS they'll be using, or what Perl version they will have. If I choose not to support a version or an OS, I am placing a limit on who might be able to use the module. Perhaps that's ok. To the extent that it's practical, I prefer to minimize the requirements placed on the user's Perl environment -- at least the requirements that I'm not able to affect.

    One thing I try to do is look at what dependencies I really need, and what requirements they impose as well. If I can't live without Moo, then I'm going to have to give up Perl 5.6, so I may as well code to 5.8+. If I can't reasonably live without a module that requires 5.10, then I may as well code to 5.10+ as well. But what I try not to do is code to 5.10 when all of my dependencies are capable of running under 5.6.

    Having said all that, I don't give a second thought to pre-5.6.

    One module that I'm involved in currently has dependencies that require 5.8, but I'm in the process of re-working it to use a different dependency so that I can support 5.6 too. (The change in dependencies gets me a few other improvements too, in this case). And this all started with a kind message from someone who has provided useful feedback on some of my other work. In this case the request went something like this: "It would be useful to me if XYZ could support 5.6, and here's what I can do to help in that regard." So there are still those out there who have a need, and some of them are appreciative and willing to extend a helpful hand in recapturing some backward compatibility.


    Dave

Re: Minimum Perl Version standard for CPAN?
by Tux (Monsignor) on Jan 24, 2013 at 08:57 UTC

    The answer is in regen/feature.pl:

    # just the relevant bits and pieces my %feature = ( say => 'say', state => 'state', switch => 'switch', evalbytes => 'evalbytes', array_base => 'arybase', current_sub => '__SUB__', lexical_subs => 'lexsubs', unicode_eval => 'unieval', unicode_strings => 'unicode', fc => 'fc', ); my %feature_bundle = ( all => [ keys %feature ], default => [qw(array_base)], "5.9.5" => [qw(say state switch array_base)], "5.10" => [qw(say state switch array_base)], "5.11" => [qw(say state switch unicode_strings array_base)], "5.13" => [qw(say state switch unicode_strings array_base)], "5.15" => [qw(say state switch unicode_strings unicode_eval eval +bytes current_sub fc)], "5.17" => [qw(say state switch unicode_strings unicode_eval eval +bytes current_sub fc)], );

    I have suggested to the developers to add this information to Module::CoreList as a new option -f.


    Enjoy, Have FUN! H.Merijn
Re: Minimum Perl Version standard for CPAN?
by Anonymous Monk on Jan 24, 2013 at 09:38 UTC
    $ perlver yo.pl
    ------------------------------------- | file | explicit | syntax | external | | ------------------------------------- | | yo.pl | ~ | v5.10.0 | n/a | | ------------------------------------- | | Minimum explicit version : ~ | | Minimum syntax version : v5.10.0 | | Minimum version of perl : v5.10.0 | -------------------------------------

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1015022]
Approved by toolic
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2014-09-02 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls