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

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

Bug Information
Severity: Normal
Broken in: 0.18
Fixed in: 0.18_01



Subject: Incorrect parsing of HEREDOCs (possibly by PPI)
The following snippet is truncated by the time it reaches the violates method. I fed this to `perlcritic -severity 1 < input' and instrumented my RequirePerlTity.pm. Is this is a PPI issue? I only noticed this because my code was perltidy clean but the RequirePerlTidy.pm was complaining that perltidy didn't find clean code. Apparently P::C or PPI was modifying my source somewhere along the way. Original source: my @clients = @{ $dbh->selectall_arrayref( <<'CLIENTS' ) || [] }; ... CLIENTS Results: my @clients = @{ $dbh->selectall_arrayref( <<'CLIENTS' ) || [] }; Instrumentation: sub violates { ... my $source = "$doc";print STDERR "<<$source>>\n"; ... Josh
From: CLOTHO [...] cpan.org
It's definitely a PPI bug. % perl -MPPI::Document -e'print PPI::Document->new("test.pl")->content' my @clients = @{ $dbh->selectall_arrayref( <<'CLIENTS' ) || [] }; %
On Fri Jul 21 15:28:01 2006, CLOTHO wrote: Show quoted text
> It's definitely a PPI bug. > > % perl -MPPI::Document -e'print PPI::Document->new("test.pl")->content' > my @clients = @{ $dbh->selectall_arrayref( <<'CLIENTS' ) || [] }; > > %
Err, my bad. It's a P::C bug, and I just committed a fix. It turns out that HEREDOC tokens are explicitly not supported under the content() method. One should instead use the PPI::Document->serialize() method. I couldn't think of a way to write a good regression test for this problem. Sorry...