Login
Added svn keywords.
[gknop/Perl-Critic.git] / lib / Perl / Critic.pm
CommitLineData
aaa8512c
JRT
1#######################################################################
2# $URL$
3# $Date$
4# $Author$
5# $Revision$
6########################################################################
7
59b05e08
JRT
8package Perl::Critic;
9
10use strict;
11use warnings;
12use File::Spec;
13use English qw(-no_match_vars);
14use Perl::Critic::Config;
15use Perl::Critic::Utils;
16use Carp;
17use PPI;
18
19our $VERSION = '0.13';
20$VERSION = eval $VERSION; ## no critic
21
22#----------------------------------------------------------------------------
23#
24sub new {
25
26 my ( $class, %args ) = @_;
27
28 # Default arguments
29 my $priority = defined $args{-priority} ? $args{-priority} : 0;
30 my $profile_path = $args{-profile};
31 my $force = $args{-force} || 0;
32
33 # Create and init object
34 my $self = bless {}, $class;
35 $self->{_force} = $force;
36 $self->{_policies} = [];
37
38 # Read profile and add policies
39 my $config = Perl::Critic::Config->new( %args );
40 while ( my ( $policy, $params ) = each %{$config} ) {
41 $self->add_policy( -policy => $policy, -config => $params );
42 }
43 return $self;
44}
45
46#----------------------------------------------------------------------------
47#
48sub add_policy {
49
50 my ( $self, %args ) = @_;
51 my $module_name = $args{-policy} || return;
52 my $config = $args{-config} || {};
53
54 #Qualify name if full module name not given
55 my $namespace = 'Perl::Critic::Policy';
56 if ( $module_name !~ m{ \A $namespace }mx ) {
57 $module_name = $namespace . q{::} . $module_name;
58 }
59
60 #Convert module name to file path. I'm trying to do
61 #this in a portable way, but I'm not sure it actually is.
62 my $module_file = File::Spec->catfile( split q{::}, $module_name );
63 $module_file .= '.pm';
64
65 #Try to load module and instantiate
66 eval {
67 require $module_file; ## no critic
68 my $policy = $module_name->new( %{$config} );
69 push @{ $self->{_policies} }, $policy;
70 };
71
72 #Failure to load is not fatal
73 if ($EVAL_ERROR) {
74 carp qq{Cannot load policy module $module_name: $EVAL_ERROR};
75 return;
76 }
77
78 return $self;
79}
80
81#----------------------------------------------------------------------------
82#
83sub critique {
84 # Here we go!
85 my ( $self, $source_code ) = @_;
86
87 # Parse the code
88 my $doc = PPI::Document->new($source_code);
89
90 # Bail on error
91 if( ! defined $doc ) {
92 my $errstr = PPI::Document::errstr();
93 my $file = -f $source_code ? $source_code : 'stdin';
94 die qq{Cannot parse code: $errstr of '$file'\n};
95 }
96
97 # Pre-index location of each node (for speed)
98 $doc->index_locations();
99
100 # Filter exempt code, if desired
101 $self->{_force} || _filter_code($doc);
102
103 # Remove the magic shebang fix
104 _unfix_shebang($doc);
105
106 # Run engine, testing each Policy at each element
107 my $elems = $doc->find( 'PPI::Element' ) || return; #Nothing to do!
108 my @pols = @{ $self->policies() }; @pols || return; #Nothing to do!
109 return map { my $e = $_; map { $_->violates($e, $doc) } @pols } @{$elems};
110}
111
112#----------------------------------------------------------------------------
113#
114sub policies { $_[0]->{_policies} }
115
116#============================================================================
117#PRIVATE SUBS
118
119sub _filter_code {
120
121 my $doc = shift;
122 my $nodes_ref = $doc->find('PPI::Token::Comment') || return;
123 my $no_critic = qr{\A \s* \#\# \s* no \s+ critic}mx;
124 my $use_critic = qr{\A \s* \#\# \s* use \s+ critic}mx;
125
126 PRAGMA:
127 for my $pragma ( grep { $_ =~ $no_critic } @{$nodes_ref} ) {
128
129 #Handle single-line usage
130 if ( my $sib = $pragma->sprevious_sibling() ) {
131 if ( $sib->location->[0] == $pragma->location->[0] ) {
132 $sib->statement->delete();
133 next PRAGMA;
134 }
135 }
136
137 SIB:
138 while ( my $sib = $pragma->next_sibling() ) {
139 my $ended = $sib->isa('PPI::Token::Comment') && $sib =~ $use_critic;
140 $sib->delete(); #$sib is undef now.
141 last SIB if $ended;
142 }
143 }
144 continue {
145 $pragma->delete();
146 }
147}
148
149sub _unfix_shebang {
150
151
152 #When you install a script using ExtUtils::MakeMaker or
153 #Module::Build, it inserts some magical code into the top of the
154 #file (just after the shebang). This code allows people to call
155 #your script using a shell, like `sh my_script`. Unfortunately,
156 #this code causes several Policy violations, so we just remove it.
157
158 my $doc = shift;
159 my $first_stmnt = $doc->schild(0) || return;
160
161
162 #Different versions of MakeMaker and Build use slightly differnt
163 #shebang fixing strings. This matches most of the ones I've found
164 #in my own Perl distribution, but it may not be bullet-proof.
165
166 my $fixin_rx = qr{^eval 'exec .* \$0 \${1\+"\$@"}'\s*[\r\n]\s*if.+;};
167 if ( $first_stmnt =~ $fixin_rx ) { $first_stmnt->delete() }
168}
169
1701;
171
172#----------------------------------------------------------------------------
173
174__END__
175
176=pod
177
178=head1 NAME
179
180Perl::Critic - Critique Perl source for style and standards
181
182=head1 SYNOPSIS
183
184 use Perl::Critic;
185
186 #Create Critic and load Policies from default config file
187 $critic = Perl::Critic->new();
188
189 #Create Critic and load only the most important Polices
190 $critic = Perl::Critic->new(-priority => 1);
191
192 #Create Critic and load Policies from specific config file
193 $critic = Perl::Critic->new(-profile => $file);
194
195 #Create Critic and load Policy by hand
196 $critic = Perl::Critic->new(-profile => 'NONE');
197 $critic->add_policy('MyPolicyModule');
198
199 #Analyze code for policy violations
200 @violations = $critic->critique($source_code);
201
202=head1 DESCRIPTION
203
204Perl::Critic is an extensible framework for creating and applying
205coding standards to Perl source code. Essentially, it is a static
206source code analysis engine. Perl::Critic is distributed with a
207number of L<Perl::Critic::Policy> modules that attempt to enforce
208various coding guidelines. Most Policies are based on Damian Conway's
209book B<Perl Best Practices>. You can choose and customize those
210Polices through the Perl::Critic interface. You can also create new
211Policy modules that suit your own tastes.
212
213For a convenient command-line interface to Perl::Critic, see the
214documentation for L<perlcritic>. If you want to integrate
215Perl::Critic with your build process, L<Test::Perl::Critic> provides a
216nice interface that is suitable for test scripts.
217
218=head1 CONSTRUCTOR
219
220=over 8
221
222=item new ( [ -profile => $FILE, -priority => $N, -include => \@PATTERNS, -exclude => \@PATTERNS, -force => 1 ] )
223
224Returns a reference to a new Perl::Critic object. Most arguments are
225just passed directly into L<Perl::Critic::Config>, but I have described
226them here as well. All arguments are optional key-value pairs as
227follows:
228
229B<-profile> is a path to a configuration file. If C<$FILE> is not
230defined, Perl::Critic::Config attempts to find a F<.perlcriticrc>
231configuration file in the current directory, and then in your home
232directory. Alternatively, you can set the C<PERLCRITIC> environment
233variable to point to a file in another location. If a configuration
234file can't be found, or if C<$FILE> is an empty string, then it
235defaults to include all the Policy modules that ship with
236Perl::Critic. See L<"CONFIGURATION"> for more information.
237
238B<-priority> is the maximum priority value of Policies that should be
239added to the Perl::Critic::Config. 1 is the "highest" priority,
240and all numbers larger than 1 have "lower" priority. Once the
241user-preferences have been read from the C<-profile>, All Policies
242that are configured with a priority greater than C<$N> will be removed
243from this Config. For a given C<-profile>, increasing C<$N> will
244result in more Policy violations. The default C<-priority> is 1. See
245L<"CONFIGURATION"> for more information.
246
247B<-include> is a reference to a list of C<@PATTERNS>. Once the
248user-preferences have been read from the C<-profile>, all Policies
249that do not match at least one C<m/$PATTERN/imx> will be removed
250from this Config. Using the C<-include> option causes the <-priority>
251option to be ignored.
252
253B<-exclude> is a reference to a list of C<@PATTERNS>. Once the
254user-preferences have been read from the C<-profile>, all Policies
255that match at least one C<m/$PATTERN/imx> will be removed from
256the Config. Using the C<-exclude> option causes the <-priority>
257option to be ignored. The C<-exclude> patterns are applied after the
258<-include> patterns, therefore, the C<-exclude> patterns take
259precedence.
260
261B<-force> controls whether Perl::Critic observes the magical C<"no
262critic"> pseudo-pragmas in your code. If set to a true value,
263Perl::Critic will analyze all code. If set to a false value (which is
264the default) Perl::Critic will overlook code that is tagged with these
265comments. See L<"BENDING THE RULES"> for more information.
266
267=back
268
269=head1 METHODS
270
271=over 8
272
273=item add_policy( -policy => $STRING [, -config => \%HASH ] )
274
275Loads a Policy into this Critic engine. The engine will attempt to
276C<require> the module named by $STRING and instantiate it. If the
277module fails to load or cannot be instantiated, it will throw a
278warning and return a false value. Otherwise, it returns a reference
279to this Critic engine.
280
281B<-policy> is the name of a L<Perl::Critic::Policy> subclass
282module. The C<'Perl::Critic::Policy'> portion of the name can be
283omitted for brevity. This argument is required.
284
285B<-config> is an optional reference to a hash of Policy configuration
286parameters (Note that this is B<not> a Perl::Critic::Config object). The
287contents of this hash reference will be passed into to the constructor
288of the Policy module. See the documentation in the relevant Policy
289module for a description of the arguments it supports.
290
291=item critique( $source_code )
292
293Runs the C<$source_code> through the Perl::Critic engine using all the
294policies that have been loaded into this engine. If C<$source_code>
295is a scalar reference, then it is treated as string of actual Perl
296code. Otherwise, it is treated as a path to a file containing Perl
297code. Returns a list of L<Perl::Critic::Violation> objects for each
298violation of the loaded Policies. The list is sorted in the order
299that the Violations appear in the code. If there are no violations,
300returns an empty list.
301
302=item policies( void )
303
304Returns a list containing references to all the Policy objects that
305have been loaded into this engine. Objects will be in the order that
306they were loaded.
307
308=back
309
310=head1 CONFIGURATION
311
312The default configuration file is called F<.perlcriticrc>.
313Perl::Critic::Config will look for this file in the current directory
314first, and then in your home directory. Alternatively, you can set
315the PERLCRITIC environment variable to explicitly point to a different
316file in another location. If none of these files exist, and the
317C<-profile> option is not given to the constructor,
318Perl::Critic::Config defaults to include all the policies that are
319shipped with Perl::Critic.
320
321The format of the configuration file is a series of named sections
322that contain key-value pairs separated by '='. Comments should
323start with '#' and can be placed on a separate line or after the
324name-value pairs if you desire. The general recipe is a series of
325blocks like this:
326
327 [Perl::Critic::Policy::Category::PolicyName]
328 priority = 1
329 arg1 = value1
330 arg2 = value2
331
332C<Perl::Critic::Policy::Category::PolicyName> is the full name of a
333module that implements the policy. The Policy modules distributed
334with Perl::Critic have been grouped into categories according to the
335table of contents in Damian Conway's book B<Perl Best Practices>. For
336brevity, you can omit the C<'Perl::Critic::Policy'> part of the
337module name. All Policy modules must be a subclass of
338L<Perl::Critic::Policy>.
339
340C<priority> is the level of importance you wish to assign to this
341policy. 1 is the "highest" priority level, and all numbers greater
342than 1 have increasingly "lower" priority. Only those policies with a
343priority less than or equal to the C<-priority> value given to the
344constructor will be loaded. The priority can be an arbitrarily large
345positive integer. If the priority is not defined, it defaults to 1.
346
347The remaining key-value pairs are configuration parameters for that
348specific Policy and will be passed into the constructor of the
349L<Perl::Critic::Policy> subclass. The constructors for most Policy
350modules do not support arguments, and those that do should have
351reasonable defaults. See the documentation on the appropriate Policy
352module for more details.
353
354By default, all the policies that are distributed with Perl::Critic
355are added to the Config. Rather than assign a priority level to a
356Policy, you can simply "turn off" a Policy by prepending a '-' to the
357name of the module in the config file. In this manner, the Policy
358will never be loaded, regardless of the C<-priority> given to the
359constructor.
360
361
362A simple configuration might look like this:
363
364 #--------------------------------------------------------------
365 # These are really important, so always load them
366
367 [TestingAndDebugging::RequirePackageStricture]
368 priority = 1
369
370 [TestingAndDebugging::RequirePackageWarnings]
371 priority = 1
372
373 #--------------------------------------------------------------
374 # These are less important, so only load when asked
375
376 [Variables::ProhibitPackageVars]
377 priority = 2
378
379 [ControlStructures::ProhibitPostfixControls]
380 priority = 2
381
382 #--------------------------------------------------------------
383 # I do not agree with these, so never load them
384
385 [-NamingConventions::ProhibitMixedCaseVars]
386 [-NamingConventions::ProhibitMixedCaseSubs]
387
388=head1 THE POLICIES
389
390The following Policy modules are distributed with Perl::Critic. The
391Policy modules have been categorized according to the table of
392contents in Damian Conway's book B<Perl Best Practices>. Since most
393coding standards take the form "do this..." or "don't do that...", I
394have adopted the convention of naming each module C<RequireSomething>
395or C<ProhibitSomething>. See the documentation of each module for
396it's specific details.
397
398=head2 L<Perl::Critic::Policy::BuiltinFunctions::ProhibitLvalueSubstr>
399
400Use 4-argument C<substr> instead of writing C<substr($foo, 2, 6) = $bar>
401
402=head2 L<Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect>
403
404Use L<Time::HiRes> instead of C<select(undef, undef, undef, .05)>
405
406=head2 L<Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval>
407
408Write C<eval { my $foo; bar($foo) }> instead of C<eval "my $foo; bar($foo);">
409
410=head2 L<Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep>
411
412Write C<grep { $_ =~ /$pattern/ } @list> instead of C<grep /$pattern/, @list>
413
414=head2 L<Perl::Critic::Policy::BuiltinFunctions::RequireBlockMap>
415
416Write C<map { $_ =~ /$pattern/ } @list> instead of C<map /$pattern/, @list>
417
418=head2 L<Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction>
419
420Use C<glob q{*}> instead of <*>
421
422=head2 L<Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless>
423
424Write C<bless {}, $class;> instead of just C<bless {};>
425
426=head2 L<Perl::Critic::Policy::CodeLayout::ProhibitHardTabs>
427
428Use spaces instead of tabs
429
430=head2 L<Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins>
431
432Write C<open $handle, $path> instead of C<open($handle, $path)>
433
434=head2 L<Perl::Critic::Policy::CodeLayout::ProhibitQuotedWordLists>
435
436Write C< qw(foo bar baz) > instead of C< ('foo', 'bar', 'baz') >
437
438=head2 L<Perl::Critic::Policy::CodeLayout::RequireTidyCode>
439
440Must run code through L<perltidy>
441
442=head2 L<Perl::Critic::Policy::CodeLayout::RequireTrailingCommas>
443
444Put a comma at the end of every multi-line list declaration, including the last one
445
446=head2 L<Perl::Critic::Policy::ControlStructures::ProhibitCascadingIfElse>
447
448Don't write long "if-elsif-elsif-elsif-elsif...else" chains
449
450=head2 L<Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops>
451
452Write C<for(0..20)> instead of C<for($i=0; $i<=20; $i++)>
453
454=head2 L<Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls>
455
456Write C<if($condition){ do_something() }> instead of C<do_something() if $condition>
457
458=head2 L<Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks>
459
460Write C<if(! $condition)> instead of C<unless($condition)>
461
462=head2 L<Perl::Critic::Policy::ControlStructures::ProhibitUntilBlocks>
463
464Write C<while(! $condition)> instead of C<until($condition)>
465
466=head2 L<Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators>
467
468Discourage stuff like C<@files = `ls $directory`>
469
470=head2 L<Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles>
471
472Write C<open my $fh, q{<}, $filename;> instead of C<open FH, q{<}, $filename;>
473
474=head2 L<Perl::Critic::Policy::InputOutput::ProhibitOneArgSelect>
475
476Never write C<select($fh)>
477
478=head2 L<Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen>
479
480Write C<open $fh, q{<}, $filename;> instead of C<open $fh, "<$filename";>
481
482=head2 L<Perl::Critic::Policy::Miscellanea::RequireRcsKeywords>
483
484Put source-control keywords in every file.
485
486=head2 L<Perl::Critic::Policy::Modules::ProhibitMultiplePackages>
487
488Put packages (especially subclasses) in separate files
489
490=head2 L<Perl::Critic::Policy::Modules::RequireBarewordIncludes>
491
492Write C<require Module> instead of C<require 'Module.pm'>
493
494=head2 L<Perl::Critic::Policy::Modules::ProhibitSpecificModules>
495
496Don't use evil modules
497
498=head2 L<Perl::Critic::Policy::Modules::RequireExplicitPackage>
499
500Always make the C<package> explicit
501
502=head2 L<Perl::Critic::Policy::Modules::RequireVersionVar>
503
504Give every module a C<$VERSION> number
505
506=head2 L<Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching>
507
508Always use the C</m> modifier with regular expressions
509
510=head2 L<Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting>
511
512Always use the C</x> modifier with regular expressions
513
514=head2 L<Perl::Critic::Policy::NamingConventions::ProhibitMixedCaseSubs>
515
516Write C<sub my_function{}> instead of C<sub MyFunction{}>
517
518=head2 L<Perl::Critic::Policy::NamingConventions::ProhibitMixedCaseVars>
519
520Write C<$my_variable = 42> instead of C<$MyVariable = 42>
521
522=head2 L<Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms>
523
524Don't declare your own C<open> function.
525
526=head2 L<Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef>
527
528Return failure with bare C<return> instead of C<return undef>
529
530=head2 L<Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes>
531
532Don't write C<sub my_function (@@) {}>
533
534=head2 L<Perl::Critic::Policy::TestingAndDebugging::RequirePackageStricture>
535
536Always C<use strict>
537
538=head2 L<Perl::Critic::Policy::TestingAndDebugging::RequirePackageWarnings>
539
540Always C<use warnings>
541
542=head2 L<Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma>
543
544Don't C< use constant $FOO => 15 >
545
546=head2 L<Perl::Critic::Policy::ValuesAndExpressions::ProhibitEmptyQuotes>
547
548Write C<q{}> instead of C<''>
549
550=head2 L<Perl::Critic::Policy::ValuesAndExpressions::ProhibitInterpolationOfLiterals>
551
552Always use single quotes for literal strings.
553
554=head2 L<Perl::Critic::Policy::ValuesAndExpressions::ProhibitLeadingZeros>
555
556Write C<oct(755)> instead of C<0755>
557
558=head2 L<Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisyQuotes>
559
560Use C<q{}> or C<qq{}> instead of quotes for awkward-looking strings
561
562=head2 L<Perl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars>
563
564Warns that you might have used single quotes when you really wanted double-quotes.
565
566=head2 L<Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators>
567
568Write C< 141_234_397.0145 > instead of C< 141234397.0145 >
569
570=head2 L<Perl::Critic::Policy::ValuesAndExpressions::RequireQuotedHeredocTerminator>
571
572Write C< print <<'THE_END' > or C< print <<"THE_END" >
573
574=head2 L<Perl::Critic::Policy::ValuesAndExpressions::RequireUpperCaseHeredocTerminator>
575
576Write C< <<'THE_END'; > instead of C< <<'theEnd'; >
577
578=head2 L<Perl::Critic::Policy::Variables::ProhibitLocalVars>
579
580Use C<my> instead of C<local>, except when you have to.
581
582=head2 L<Perl::Critic::Policy::Variables::ProhibitPackageVars>
583
584Eliminate globals declared with C<our> or C<use vars>
585
586=head2 L<Perl::Critic::Policy::Variables::ProhibitPunctuationVars>
587
588Write C<$EVAL_ERROR> instead of C<$@>
589
590=head1 BENDING THE RULES
591
592B<NOTE:> This feature changed in version 0.09 and is not backward
593compatible with earlier versions.
594
595Perl::Critic takes a hard-line approach to your code: either you
596comply or you don't. In the real world, it is not always practical
597(or even possible) to fully comply with coding standards. In such
598cases, it is wise to show that you are knowingly violating the
599standards and that you have a Damn Good Reason (DGR) for doing so.
600
601To help with those situations, you can direct Perl::Critic to ignore
602certain lines or blocks of code by using pseudo-pragmas:
603
604 require 'LegacyLibaray1.pl'; ## no critic
605 require 'LegacyLibrary2.pl'; ## no critic
606
607 for my $element (@list) {
608
609 ## no critic
610
611 $foo = ""; #Violates 'ProhibitEmptyQuotes'
612 $barf = bar() if $foo; #Violates 'ProhibitPostfixControls'
613 #Some more evil code...
614
615 ## use critic
616
617 #Some good code...
618 do_something($_);
619 }
620
621The C<"## no critic"> comments direct Perl::Critic to overlook the
622remaining lines of code until the end of the current block, or until a
623C<"## use critic"> comment is found (whichever comes first). If the
624C<"## no critic"> comment is on the same line as a code statement,
625then only that line of code is overlooked. To direct perlcritic to
626ignore the C<"## no critic"> comments, use the C<-force> option.
627
628Use this feature wisely. C<"## no critic"> should be used in the
629smallest possible scope, or only on individual lines of code. If
630Perl::Critic complains about your code, try and find a compliant
631solution before resorting to this feature.
632
633=head1 EXTENDING THE CRITIC
634
635The modular design of Perl::Critic is intended to facilitate the
636addition of new Policies. To create a new Policy, make a subclass of
637L<Perl::Critic::Policy> and override the C<violates()> method. Your
638module should go somewhere in the Perl::Critic::Policy namespace. To
639use the new Policy, just add it to your F<.perlcriticrc> file. You'll
640need to have some understanding of L<PPI>, but most Policy modules are
641pretty straightforward and only require about 20 lines of code.
642
643If you develop any new Policy modules, feel free to send them to
644<thaljef@cpan.org> and I'll be happy to put them into the Perl::Critic
645distribution.
646
647=head1 IMPORTANT CHANGES
648
649As new Policy modules were added to Perl::Critic, the overall
650performance started to deteriorate rapidly. Since each module would
651traverse the document (several times for some modules), a lot of time
652was spent iterating over the same document nodes. So starting in
653version 0.11, I have switched to a stream-based approach where the
654document is traversed once and every Policy module is tested at each
655node. The result is roughly a 300% improvement.
656
657Unfortunately, Policy modules prior to version 0.11 won't be
658compatible. Hopefully, few people have started creating their own
659Policy modules. Converting them to the stream-based model is fairly
660easy, and actually results in somewhat cleaner code. Look at the
661ControlStrucutres::* modules for some examples.
662
663=head1 PREREQUISITES
664
665Perl::Critic requires the following modules:
666
667L<PPI>
668
669L<Config::Tiny>
670
671L<File::Spec>
672
673L<List::Util>
674
675L<List::MoreUtils>
676
677L<Pod::Usage>
678
679L<Pod::PlainText>
680
681L<IO::String>
682
683L<String::Format>
684
685The following modules are optional, but recommended for complete
686testing:
687
688L<Test::Pod>
689
690L<Test::Pod::Coverage>
691
692L<Test::Perl::Critic>
693
694=head1 BUGS
695
696Scrutinizing Perl code is hard for humans, let alone machines. If you
697find any bugs, particularly false-positives or false-negatives from a
698Perl::Critic::Policy, please submit them to
699L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Critic>. Thanks.
700
701=head1 CREDITS
702
703Adam Kennedy - For creating L<PPI>, the heart and soul of Perl::Critic.
704
705Damian Conway - For writing B<Perl Best Practices>
706
707Giuseppe Maxia - For all the great ideas and enhancements.
708
709Chris Dolan - For numerous bug reports and suggestions.
710
711Sharon, my wife - For putting up with my all-night code sessions
712
713=head1 AUTHOR
714
715Jeffrey Ryan Thalhammer <thaljef@cpan.org>
716
717=head1 COPYRIGHT
718
719Copyright (c) 2005 Jeffrey Ryan Thalhammer. All rights reserved.
720
721This program is free software; you can redistribute it and/or modify
722it under the same terms as Perl itself. The full text of this license
723can be found in the LICENSE file included with this module.
724
725=cut