1Perl::Critic::Theme(3)User Contributed Perl DocumentationPerl::Critic::Theme(3)
2
3
4
6 Perl::Critic::Theme - Construct thematic sets of policies
7
9 This is a helper class for evaluating theme expressions into sets of
10 Policy objects. There are no user-serviceable parts here.
11
13 "new( -rule => $rule_expression"
14 Returns a reference to a new Perl::Critic::Theme object.
15 "-rule" is a string expression that evaluates to true or false
16 for each Policy.. See "THEME RULES" for more information.
17
18 "policy_is_thematic( -policy => $policy )"
19 Given a reference to a Perl::Critic::Policy object, this method
20 returns evaluates the rule against the themes that are associ‐
21 ated with the Policy. Returns 1 if the Policy satisfies the
22 rule, 0 otherwise.
23
24 " rule() "
25 Returns the rule expression that was used to construct this
26 Theme. The rule may have been translated into a normalized
27 expression. See "THEME RULES" for more information.
28
29 THEME RULES
30
31 A theme rule is a simple boolean expression, where the operands are the
32 names of any of the themes associated with the Perl::Critic::Polices.
33
34 Theme names can be combined with logical operators to form arbitrarily
35 complex expressions. Precedence is the same as normal mathematics, but
36 you can use parens to enforce precedence as well. Supported operators
37 are:
38
39 Operator Altertative Example
40 ----------------------------------------------------------------------------
41 && and 'pbp && core'
42 ⎪⎪ or 'pbp ⎪⎪ (bugs && security)'
43 ! not 'pbp && ! (portability ⎪⎪ complexity)
44
45 See "CONFIGURATION" in Perl::Critic for more information about cus‐
46 tomizing the themes for each Policy.
47
49 Jeffrey Thalhammer <thaljef@cpan.org>
50
52 Copyright (c) 2006 Jeffrey Thalhammer
53
54 This program is free software; you can redistribute it and/or modify it
55 under the same terms as Perl itself. The full text of this license can
56 be found in the LICENSE file included with this module.
57
58
59
60perl v5.8.8 2007-03-20 Perl::Critic::Theme(3)