Perl::Critic::Policy::Dynamic::NoIndirect - Perl::Critic policy against indirect method calls.
This Perl::Critic dynamic policy reports any use of indirect object syntax with a
It's listed under the
The uses of the indirect pragma inside the audited code take precedence over this policy.
Hence no violations will be reported for indirect method calls that are located inside the lexical scope of
use indirect or
no indirect hook => ....
no indirect won't be a problem.
Since the reports generated by indirect are remapped to the corresponding PPI::Element objects, the order in which the violations are returned is different from the order given by indirect : the former is the document order (top to bottom, left to right) while the latter is the optree order (arguments before function calls).
Perl::Critic::Policy::Objects::ProhibitIndirectSyntax is a Perl::Critic policy that statically checks for indirect constructs. But to be static it has to be very restricted : you have to manually specify which subroutine names are methods for which the indirect form should be forbidden. This can lead to false positives (a subroutine with the name you gave is defined in the current scope) and negatives (indirect constructs for methods you didn't specify). But you don't need to actually compile (or run, as it's more or less the same thing) the code.
<perl at profvince.com>,
You can contact me by mail or on
Please report any bugs or feature requests to
bug-perl-critic-policy-dynamic-noindirect at rt.cpan.org,
or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Critic-Policy-Dynamic-NoIndirect.
I will be notified,
and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
Copyright 2009,2010,2011 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.