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: 27073
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: bwarfield [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.04
Fixed in: (no value)



Subject: False positive in RequireUpperCaseHeredocTerminator
If a heredoc terminator is quoted with whitespace between the << and the terminator, it fails to match the regular expression in the RequireUpperCaseHeredocTerminator policy, potentially producing a spurious policy violation. Example case: my $text = << "END_TEXT"; text here END_TEXT The attached patch changes the regex to allow whitespace if it is followed by a single or double quote.
Subject: perlcritic_heredoc.patch
--- Perl/Critic/Policy/ValuesAndExpressions/RequireUpperCaseHeredocTerminator.pm.org 2007-05-10 17:28:16.000000000 -0400 +++ Perl/Critic/Policy/ValuesAndExpressions/RequireUpperCaseHeredocTerminator.pm 2007-05-10 17:31:13.000000000 -0400 @@ -16,7 +16,7 @@ #----------------------------------------------------------------------------- -my $heredoc_rx = qr{ \A << ["|']? [A-Z_] [A-Z0-9_]* ['|"]? \z }x; +my $heredoc_rx = qr{ \A << (?: \s* ["|'])? [A-Z_] [A-Z0-9_]* ['|"]? \z }x; my $desc = q{Heredoc terminator not alphanumeric and upper-case}; my $expl = [ 64 ];
Subject: Re: [rt.cpan.org #27073] False positive in RequireUpperCaseHeredocTerminator
Date: Thu, 17 May 2007 09:26:21 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Jeffrey Thalhammer <jeffrey_thalhammer [...] yahoo.com>
Thanks. I'll fix this in the next release, which should be ready within a couple weeks. ____________________________________________________________________________________Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. http://tv.yahoo.com/collections/222
Fixed and released in Perl-Critic-1.053. Thanks for reporting this.