To clarify: as of writing, on Perl 5.28.1 and Perldoc v3.2801:
- =for comment hides text from perl but not perldoc
- =begin comment hides text from both perl and perldoc
=head1 SECTION =for comment Comment! =cut =begin comment Comment! Number 2 =end comment =cut
- perl foo.pl produces empty output and no errors
- perldoc foo.pl produces:
which is the text from the =for comment / =cut block.