Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 43314
Status: resolved
Priority: 0/
Queue: Perl-Critic-StricterSubs

People
Owner: Nobody in particular
Requestors: perl [...] galumph.com
Cc:
AdminCc:

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



Subject: Modules::RequireExplicitInclusion with __PACKAGE__
Date: Sun, 15 Feb 2009 11:19:27 -0600
To: bug-Perl-Critic-StricterSubs [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
The policy says that __PACKAGE__ should be imported before use, but __PACKAGE__ already exists always. use Test::Simple tests => 1; use Perl::Critic qw(); my $violation = Perl::Critic->new('-single-policy' => 'Modules::RequireExplicitInclusion')->critique(\<<'PERL'); use Moose; __PACKAGE__->meta->make_immutable; PERL ok !$violation, 'exempts __PACKAGE__ from inclusion';
On Sun Feb 15 12:19:46 2009, clonezone wrote: Show quoted text
> The policy says that __PACKAGE__ should be imported before use, but > __PACKAGE__ already exists always. > > use Test::Simple tests => 1; > use Perl::Critic qw(); > my $violation = Perl::Critic->new('-single-policy' => > 'Modules::RequireExplicitInclusion')->critique(\<<'PERL'); > use Moose; > __PACKAGE__->meta->make_immutable; > PERL > > ok !$violation, 'exempts __PACKAGE__ from inclusion';
A patch for this has been committed as SVN revision 3981. Take note that the patch does _not_ willy-nilly allow __PACKAGE__::foo() or $__PACKAGE__::foo.
This has finally been released as Perl-Critic-StricterSubs-0.04 https://metacpan.org/release/Perl-Critic-StricterSubs Thanks for your patience.