Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 25085
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: dean.wilson [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.01
Fixed in: (no value)



Subject: False Positive - Heredoc terminator must be quoted
The heredoc quoting test breaks if a space is present before the closing identifier. $ perlcritic -3 Tester.pm # Invocation # Heredoc terminator must be quoted at line 7, column 18. See page 62 of PBP. (Severity: 3) package Tester; use strict; use warnings; sub broken_case { my $template = << 'END_OF_TEMPLATE'; this is a multiline here document END_OF_TEMPLATE return; } sub working_case { my $template = <<'END_OF_TEMPLATE'; this is a multiline here document END_OF_TEMPLATE return; } 1;
From: DAGOLDEN [...] cpan.org
On Thu Feb 22 10:19:33 2007, DWILSON wrote: Show quoted text
> The heredoc quoting test breaks if a space is present before the closing > identifier. > > $ perlcritic -3 Tester.pm # Invocation > # Heredoc terminator must be quoted at line 7, column 18. See page 62 > of PBP. (Severity: 3) > > package Tester; > use strict; > use warnings; > > > sub broken_case { > > my $template = << 'END_OF_TEMPLATE'; > this is a multiline > here document > END_OF_TEMPLATE > > return; > } > > sub working_case { > > my $template = <<'END_OF_TEMPLATE'; > this is a multiline > here document > END_OF_TEMPLATE > > return; > } > > 1;
Addendum: according to perlop, a space may only exist after the ">>" if the heredoc terminator is quoted. Perhaps the regex in RequireQuotedHeredocTerminator should be: qr/ \A << \s* ["|'] .* ['|"] \z /x; I was a little surprised that the regex doesn't bother to make sure the quotes match, but I guess that's not what Perl::Critic cares about as the compiler would catch it anyway.
From: THALJEF [...] cpan.org
Fixed in SVN revision 1268. This will be released in Perl-Critic-1.04 which should be ready in the next couple weeks. Thanks for sending the bug report. -Jeff
This has been fixed in Perl-Critic-1.04 which has just been uploaded to CPAN. Thanks for reporting this! -Jeff