criticism(3) User Contributed Perl Documentation criticism(3) NNAAMMEE criticism - Perl pragma to enforce coding standards SSYYNNOOPPSSIISS use criticism; use criticism 'gentle'; use criticism 'stern'; use criticism 'harsh'; use criticism 'cruel'; use criticism 'brutal'; DDEESSCCRRIIPPTTIIOONN This pragma runs your file through Perl::Critic before every execution. In practice, this isn't always feasible because it adds a great deal of overhead at start-up. Unless you really don't mind the wait, you're probably better off using the perlcritic command-line or Test::Perl::Critic. For scripts, you can manually load the "criticism" pragma at the com- mand-line like this: perl -Mcriticism=cruel your_script.pl Or if you only want to run Perl::Critic during development and you have not installed Perl::Critic in your production environment, try this: eval { require criticism; criticism->import( 'cruel' ); }; CCOONNFFIIGGUURRAATTIIOONN The import argument is a named equivalent to the numeric severity lev- els in Perl::Critic. For example, "use criticism 'gentle';" reports only the most dangerous violations. On the other hand, "use criticism 'brutal';" reports eevveerryy violation. If the import argument is not defined, it defaults to 'gentle'. The "criticsm" pragma will obey whatever configurations you have set in your _._p_e_r_l_c_r_i_t_i_c_r_c file. See "CONFIGURATION" in Perl::Critic for more details. NNOOTTEESS The "criticism" pragma will apply to the whole file, so it is not affected by scope boundaries and "use"-ing it mutliple times will just cause it to reprocess the same file. There isn't a reciprocal "no criticism" pragma. However, Perl::Critic does support a pseudo-pragma that directs it to overlook certain lines or blocks of code. See "BENDING THE RULES" in Perl::Critic for more details. AAUUTTHHOORR Jeffrey Ryan Thalhammer CCOOPPYYRRIIGGHHTT Copyright (c) 2006 Jeffrey Ryan Thalhammer. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.8.7 2006-01-14 criticism(3)