1Perl::Critic::Policy::DUosPceeurrmleC:no:tnCatrtriiitobinuc:t::e:RdPeoqPlueiircrlye:FD:ioDncoauclmuCemunettn(at3ta)itoinon::RequireFinalCut(3)
2
3
4

NAME

6       Perl::Critic::Policy::Documentation::RequireFinalCut - end POD with
7       =cut directive
8

DESCRIPTION

10       This policy is part of the "Perl::Critic::Pulp" add-on.  It asks you to
11       end POD with a "=cut" directive at the end of a file.
12
13           =head1 DOCO
14
15           Some text.
16
17           =cut             # ok
18
19       The idea is to have a definite end indication for human readers.  Perl
20       and the POD processors don't require a final "=cut".  On that basis
21       this policy is lowest severity and under the "cosmetic" theme (see
22       "POLICY THEMES" in Perl::Critic).
23
24       If there's no POD in the file then a "=cut" is not required.  Or if the
25       file ends with code rather than POD then a "=cut" after that code is
26       not required.
27
28           =head2 About foo
29
30           =cut
31
32           sub foo {
33           }              # ok, file ends with code not POD
34
35       If there's POD at end of file but consists only of "=begin/=end" blocks
36       then a "=cut" is not required.  It's reckoned the "=end" is enough in
37       this case.
38
39           =begin wikidoc
40
41           Entire document in wiki style.
42
43           =end wikidoc          # ok, =cut not required
44
45       If the file ends with a mixture of ordinary POD and "=begin" blocks
46       then a is still required.  The special allowance is when only "=begin"
47       blocks, presumably destined for some other markup system.
48
49   Blank Line
50       Generally a "=cut" should have a blank line before it, the same as
51       other POD commands.  But Perl execution doesn't enforce that and the
52       same looseness is permitted here,
53
54           =pod
55
56           Blah blah blah
57           =cut                  # ok without preceding newline
58
59       A check for blanks around POD commands is left to other policies.  The
60       "podchecker" program reports this (Pod::Checker).
61
62   Disabling
63       If you don't care about a final "=cut" you can disable
64       "RequireFinalCut" from your .perlcriticrc in the usual way (see
65       "CONFIGURATION" in Perl::Critic),
66
67           [-Documentation::RequireFinalCut]
68

SEE ALSO

70       Perl::Critic::Pulp, Perl::Critic
71
72       Perl::Critic::Policy::Documentation::RequireEndBeforeLastPod,
73       Perl::Critic::Policy::Documentation::RequirePodAtEnd
74

HOME PAGE

76       <http://user42.tuxfamily.org/perl-critic-pulp/index.html>
77
79       Copyright 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2021 Kevin Ryde
80
81       Perl-Critic-Pulp is free software; you can redistribute it and/or
82       modify it under the terms of the GNU General Public License as
83       published by the Free Software Foundation; either version 3, or (at
84       your option) any later version.
85
86       Perl-Critic-Pulp is distributed in the hope that it will be useful, but
87       WITHOUT ANY WARRANTY; without even the implied warranty of
88       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
89       General Public License for more details.
90
91       You should have received a copy of the GNU General Public License along
92       with Perl-Critic-Pulp.  If not, see <http://www.gnu.org/licenses/>.
93
94
95
96perl v5.38.0           Perl::Criti2c0:2:3P-o0l7i-c2y1::Documentation::RequireFinalCut(3)
Impressum