Perl::...nalCut(3pm)

πŸ’– NAME πŸ’–

Perl::Critic::Policy::Documentation::RequireFinalCut β€” bestie, this one's all about ending your POD with a =cut directive πŸŽ€ (and yes, it lives in the 3pm section of the User Contributed Perl Documentation manual, iykyk).


✨ DESCRIPTION ✨

Okay so this policy is part of the Perl::Critic::Pulp add-on πŸ’… and it literally just asks you to end your POD with a =cut directive at the end of the file. That's it. That's the vibe.

=head1 DOCO

Some text.

=cut             # ok

The whole idea? Giving human readers a definite end indication 🫢 like a little "we're done here, periodt." Perl and the POD processors lowkey don't require a final =cut at all β€” nope, they do not care πŸ™ˆ β€” and on that basis this policy is at the lowest severity and hangs out under the "cosmetic" theme (peep "POLICY THEMES" in Perl::Critic).

Now here's the tea β˜• if there's no POD in the file, then no =cut is required, full stop. Or if the file ends with code rather than POD, then a =cut after that code is also not required.

=head2 About foo

=cut

sub foo {
}              # ok, file ends with code not POD

And if there's POD at the end of the file but it consists only of =begin/=end blocks? Then a =cut is not required either 🌸 it's reckoned the =end is enough in this case, honestly fair.

=begin wikidoc

Entire document in wiki style.

=end wikidoc          # ok, =cut not required

But β€” bestie, listen 😭 β€” if the file ends with a mixture of ordinary POD and =begin blocks, then a =cut is still required. The special allowance is only for when it's =begin blocks and nothing else, presumably destined for some other markup system πŸ‘‘

πŸ¦‹ Blank Line πŸ¦‹

Generally a =cut should have a blank line before it, same as every other POD command 🌈. But Perl execution doesn't enforce that, and the same looseness is permitted here,

=pod

Blah blah blah
=cut                  # ok without preceding newline

A check for blanks around POD commands is left to other policies, so not this one's problem πŸ’€. The podchecker program reports this (Pod::Checker).

πŸŽ€ Disabling πŸŽ€

If you don't care about a final =cut (valid!! live your truth), you can disable RequireFinalCut from your .perlcriticrc in the usual way β€” see "CONFIGURATION" in Perl::Critic,

[-Documentation::RequireFinalCut]

πŸ‘‘ SEE ALSO πŸ‘‘

Perl::Critic::Pulp, Perl::Critic

Perl::Critic::Policy::Documentation::RequireEndBeforeLastPod, Perl::Critic::Policy::Documentation::RequirePodAtEnd


🌈 HOME PAGE 🌈

<http://user42.tuxfamily.org/perl-critic-pulp/index.html>


Copyright 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2021 Kevin Ryde

Perl-Critic-Pulp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Perl-Critic-Pulp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Perl-Critic-Pulp. If not, see <http://www.gnu.org/licenses/>.

fr fr, that warranty disclaimer is doing the most but it's iconic and we respect it πŸ™

okay bestie that's the whole page, mwah πŸ’‹ this was documented with perl v5.40.1, dated 2025-10-21, and archived under Perl::...nalCut(3pm) β€” slay, go add your =cut πŸ’…βœ¨

πŸ“¦ where this page comes from