Perl-Critic / Perl-Critic-StricterSubs

Perl::Critic plugin for stricter subroutine checks
http://perlcritic.com
Other
9 stars 3 forks source link

Packagename is detected wrongly by RequireExplicitInclusion if preceeded with minus #6

Open ksmadsen opened 9 years ago

ksmadsen commented 9 years ago

A testcase to illustrate the problem:

## name Correct packagename, when starting with minus
## failures 0
## TODO This isn't working yet
## cut
use Foo::Bar;

-Foo::Bar->test();

The errormessage in this case is "Use of "::Bar" without including "::Bar" Without importing a package, it is unlikely that references to things inside it even exist.", so it appears that the minus confuses the code that computes the packagename. If the minus is changed to a +, the test passes.