Skip Menu |

This queue is for tickets about the Modern-Perl CPAN distribution.

Report information
The Basics
Id: 102246
Status: resolved
Priority: 0/
Queue: Modern-Perl

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc: DBOOK [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Recommended year specification syntax
Is there a reason why the recommended way to specify a Modern::Perl version is as use Modern::Perl '2014'; and not the unquoted use Modern::Perl 2014; The current recommended style clashes with a 'best practice' recommended by perlcritic, to use bare numbers not quoted numbers. Of course, if there is a good reason for the current style then it is perlcritic that needs fixing. Could you comment please?
On Fri Feb 20 06:54:27 2015, EDAVIS wrote: Show quoted text
> Is there a reason why the recommended way to specify a Modern::Perl > version is as > > use Modern::Perl '2014'; > > and not the unquoted > > use Modern::Perl 2014; > > The current recommended style clashes with a 'best practice' > recommended by perlcritic, to use bare numbers not quoted numbers. Of > course, if there is a good reason for the current style then it is > perlcritic that needs fixing. Could you comment please?
I would say moreso that there is no good reason for that policy. Please remember that is a Perl Best Practices recommendation, not a "perlcritic" recommendation, and Perl::Critic only has those policies as a default. In this case, '2014' is decidedly a string which is used by the module to determine which features to enable.
On Wed Dec 28 19:12:10 2016, DBOOK wrote: Show quoted text
> In this case, '2014' is decidedly a string which is used by the module > to determine which features to enable.
Exactly right. If 2014 were a version number, it'd be awkward to manage and release multiple versions per year, and it would be awkward to manage multiple feature sets per module. I tried with bare numbers for a few ways, and never found a combination of API and VERSION() sub that seemed both usable and supportable with Perl's module loading semantics.