Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 65839
Status: open
Priority: 0/
Queue: Perl-Critic

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

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



Subject: Allow VERSION declarations in BEGIN blocks prior to use strict; use warnings;
As mentioned in https://rt.cpan.org/Ticket/Display.html?id=28676: It'd be nice to allow declaring VERSION in a BEGIN block: package App::perlhl; BEGIN { $App::perlhl::VERSION = '0.002'; } use strict; use warnings; #... without warning about having code before strict and warnings.
Subject: Re: [rt.cpan.org #65839] Allow VERSION declarations in BEGIN blocks prior to use strict; use warnings;
Date: Thu, 17 Feb 2011 18:42:36 -0600
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
On 2/17/11 7:56 AM, Mike Doherty via RT wrote: Show quoted text
> package App::perlhl; > BEGIN { > $App::perlhl::VERSION = '0.002'; > } > use strict; > use warnings;
I don't like this idiom. And why can't that be put after the strict and warnings? If this is a Dist::Zilla thing, then I consider Dist::Zilla broken and not Perl::Critic.
Subject: Re: [rt.cpan.org #65839] Allow VERSION declarations in BEGIN blocks prior to use strict; use warnings;
Date: Thu, 17 Feb 2011 21:26:26 -0400
To: bug-Perl-Critic [...] rt.cpan.org
From: Mike Doherty <doherty [...] cs.dal.ca>
On 11-02-17 08:42 PM, Elliot Shank via RT wrote: Show quoted text
>> BEGIN { >> $App::perlhl::VERSION = '0.002'; >> }
> I don't like this idiom. And why can't that be put after the strict > and warnings? If this is a Dist::Zilla thing, then I consider > Dist::Zilla broken and not Perl::Critic.
It is one available idiom. Like just about everything in Dist::Zilla, it is the user's choice which one to use.
On Thu Feb 17 20:26:35 2011, doherty@cs.dal.ca wrote: Show quoted text
> On 11-02-17 08:42 PM, Elliot Shank via RT wrote:
> >> BEGIN { > >> $App::perlhl::VERSION = '0.002'; > >> }
> > I don't like this idiom. And why can't that be put after the strict > > and warnings? If this is a Dist::Zilla thing, then I consider > > Dist::Zilla broken and not Perl::Critic.
> > It is one available idiom. Like just about everything in Dist::Zilla, it > is the user's choice which one to use.
Though almost all users choose it since it is core Dist::Zilla and there are no other options in the core package.