Perl::Critic::Policy::Subroutines::ProhibitQualifiedSubDeclarations
This policy is part of Perl::Critic::StricterSubs.
Perl permits you to declare subroutines into any package that you want. This can be downright dangerous if that package is already defined elsewhere.
package Foo; sub Bar::frobulate {} #not ok sub frobulate {} #ok
Even if you declare a subroutine into the current package, using a fully-qualified name is just weird.
package Foo; sub Foo::frobulate {} #not ok sub frobulate {} #ok
So this Policy catches any subroutine declaration that contains "::" in the subroutine's name.
Overriding subroutines in other packages is a common testing technique. So you may want to disable this policy when critiquing test scripts.
Jeffrey Ryan Thalhammer <thaljef@cpan.org>
Copyright (c) 2007 Jeffrey Ryan Thalhammer. All rights reserved.
To install Perl::Critic::StricterSubs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::StricterSubs
CPAN shell
perl -MCPAN -e shell install Perl::Critic::StricterSubs
For more information on module installation, please visit the detailed CPAN module installation guide.