The subject Perl-Critic policy is an alternate implementation of the core policy
Variables::ProhibitUnusedVariables. My implementation attempts to do a more thorough job of finding unused variables.
The details of the policy can be found at Perl-Critic-Policy-Variables-ProhibitUnusedVarsStricter. My purpose here is more to discuss why the policy exists in the form it does.
Once upon a time there was something called
warnings::unused. This was an XS module that required the code under analysis to be actually run. This has since been retracted, or at least I can find nothing by that name in CPAN.
There is also a
Variables::ProhibitUnusedVariables. This is "safe" in the sense that no code has to be run, but it is also a fairly simple policy, which by design and intent prefers false negative results to false positives.
It seems to me that in the absence of
warnings::unused something more comprehensive should be out there, and embedding the tool in the
Perl-Critic framework seems like the logical thing to do. But because the more aggressive analysis makes false positives more likely, this policy should not be in the core.
ProhibitUnusedVarsStricter currently exists only as a development release, which I consider to be alpha code. I plan to keep it there for a month or so, so people can bang on it and give feedback, and so I can (if need be) freely jerk it around in response to that feedback. The feedback can be any way you can get it to me. For public discussion I can't think of any better alternative than a reply to this blog.