Perl::Critic::Policy::Documentation::RequireFinalCut3pm
End pod with =cut directive
Overview
This policy is part of the "Perl::Critic::Pulp" add-on. It asks you to end POD with a "=cut" directive at the end of a file.
=head1 DOCOSome text.=cut # ok
The idea is to have a definite end indication for human readers. Perl and the POD processors don't require a final "=cut". On that basis this policy is lowest severity and under the "cosmetic" theme (see "POLICY THEMES" in Perl::Critic).
If there's no POD in the file then a "=cut" is not required. Or if the file ends with code rather than POD then a "=cut" after that code is not required.
=head2 About foo=cutsub foo {} # ok, file ends with code not POD
If there's POD at end of file but consists only of "=begin/=end" blocks then a "=cut" is not required. It's reckoned the "=end" is enough in this case.
=begin wikidocEntire document in wiki style.=end wikidoc # ok, =cut not required
If the file ends with a mixture of ordinary POD and "=begin" blocks then a is still required. The special allowance is when only "=begin" blocks, presumably destined for some other markup system.
Blank Line
Generally a "=cut" should have a blank line before it, the same as other POD commands. But Perl execution doesn't enforce that and the same looseness is permitted here,
=podBlah blah blah=cut # ok without preceding newline
A check for blanks around POD commands is left to other policies. The "podchecker" program reports this (Pod::Checker).
Disabling
If you don't care about a final "=cut" you can disable "RequireFinalCut" from your .perlcriticrc in the usual way (see "CONFIGURATION" in Perl::Critic),
[-Documentation::RequireFinalCut]
Home page
<http://user42.tuxfamily.org/perl-critic-pulp/index.html>
Releases
4 releases since Debian 10 (Buster); the text changed 1 time.