Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator(3pm)

Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator3pm

Don't write " print <<'__end__' ".

Affiliation

This Policy is part of the core Perl::Critic distribution.

Overview

Using one of Perl's special literals as a HEREDOC terminator could be confusing to tools that try to parse perl.

    print <<'__END__';           #not ok
    Hello world
    __END__
    print <<'__END_OF_WORLD__';  #ok
    Goodbye world!
    __END_OF_WORLD__

The special literals that this policy prohibits are:

__END__
__DATA__
__PACKAGE__
__FILE__
__LINE__

Configuration

This Policy is not configurable except for the standard options.

Releases

9 releases since Debian 6.0 (Squeeze); the text changed 8 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13
  9. Arch

Author

Kyle Hasselbacher <[email protected]>

From perl-perl-critic 1.156-3 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.