2 Perl::Critic::Policy::Dynamic::NoIndirect - Perl::Critic policy against
9 This Perl::Critic dynamic policy reports any use of indirect object
10 syntax with a 'stern' severity. It's listed under the 'dynamic' and
13 Since it wraps around indirect, it needs to compile the audited code and
14 as such is implemented as a subclass of Perl::Critic::DynamicPolicy.
17 The uses of the indirect pragma inside the audited code take precedence
18 over this policy. Hence no violations will be reported for indirect
19 method calls that are located inside the lexical scope of "use indirect"
20 or "no indirect hook => ...". Occurrences of "no indirect" won't be a
23 Since the reports generated by indirect are remapped to the
24 corresponding PPI::Element objects, the order in which the violations
25 are returned is different from the order given by indirect : the former
26 is the document order (top to bottom, left to right) while the latter is
27 the optree order (arguments before function calls).
32 Perl::Critic, Perl::Critic::Dynamic.
37 Perl::Critic::Policy::Objects::ProhibitIndirectSyntax is a Perl::Critic
38 policy that statically checks for indirect constructs. But to be static
39 it has to be very restricted : you have to manually specify which
40 subroutine names are methods for which the indirect form should be
41 forbidden. This can lead to false positives (a subroutine with the name
42 you gave is defined in the current scope) and negatives (indirect
43 constructs for methods you didn't specify). But you don't need to
44 actually compile (or run, as it's more or less the same thing) the code.
47 Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
49 You can contact me by mail or on "irc.perl.org" (vincent).
52 Please report any bugs or feature requests to
53 "bug-perl-critic-policy-dynamic-noindirect at rt.cpan.org", or through
55 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Critic-Policy-Dynam
56 ic-NoIndirect>. I will be notified, and then you'll automatically be
57 notified of progress on your bug as I make changes.
60 You can find documentation for this module with the perldoc command.
62 perldoc Perl::Critic::Policy::Dynamic::NoIndirect
65 Copyright 2009,2010,2011 Vincent Pit, all rights reserved.
67 This program is free software; you can redistribute it and/or modify it
68 under the same terms as Perl itself.