5 do_something() if $condition;
6 do_something() while $condition;
7 do_something() until $condition;
8 do_something() unless $condition;
9 do_something() for @list;
10 do_something() foreach @list;
12 #-----------------------------------------------------------------------------
14 ## name Configured to allow all
16 ## parms {allow => 'if while until unless for foreach'}
19 do_something() if $condition;
20 do_something() while $condition;
21 do_something() until $condition;
22 do_something() unless $condition;
23 do_something() for @list;
24 do_something() foreach @list;
26 #-----------------------------------------------------------------------------
28 ## name Configured to allow all, all regular control structures
30 ## parms {allow => 'if unless until while'}
33 if($condition){ do_something() }
34 while($condition){ do_something() }
35 until($condition){ do_something() }
36 unless($condition){ do_something() }
38 #-----------------------------------------------------------------------------
40 ## name Regular for loops
44 #PPI versions < 1.03 had problems with this
45 for my $element (@list){ do_something() }
46 for (@list){ do_something_else() }
47 foreach my $element (@list){ do_something() }
48 foreach (@list){ do_something_else() }
50 #-----------------------------------------------------------------------------
52 ## name Legal postfix usage
63 goto HELL if $condition;
67 die 'message' if $condition;
70 warn 'message' if $condition;
73 carp 'message' if $condition;
76 croak 'message' if $condition;
79 cluck 'message' if $condition;
82 confess 'message' if $condition;
83 confess if $condition;
88 #-----------------------------------------------------------------------------
90 ## name override exempt flowcontrols
92 ## parms {flowcontrol => 'assert'}
97 assert $something if $condition;
100 #-----------------------------------------------------------------------------
102 ## name overriding exempt flowcontrols restores the defaults
104 ## parms {flowcontrol => 'assert'}
109 warn $something if $condition;
110 die $something if $condition;
111 carp $something if $condition;
112 croak $something if $condition;
113 cluck $something if $condition;
114 confess $something if $condition;
115 exit $something if $condition;
116 do_something() if $condition;
118 #-----------------------------------------------------------------------------
120 ## name Individual "keyword" hash assignment
132 #-----------------------------------------------------------------------------
134 ## name "Keyword"-list hash assignment
147 #-----------------------------------------------------------------------------
149 ##############################################################################
150 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/ControlStructures/ProhibitPostfixControls.run $
151 # $Date: 2008-03-16 17:40:45 -0500 (Sun, 16 Mar 2008) $
152 # $Author: clonezone $
154 ##############################################################################
158 # cperl-indent-level: 4
160 # indent-tabs-mode: nil
161 # c-indentation-style: bsd
163 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :