Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 45471
Status: resolved
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: max [...] scoubidou.com
Cc:
AdminCc:

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



Subject: PPI bug
Date: Mon, 27 Apr 2009 16:28:58 +0200
To: bug-PPI [...] rt.cpan.org
From: Maxime Soulé <max [...] scoubidou.com>
Download (untitled) / with headers
text/plain 574b
Hello, I use PPI to strip comments, PODs and the likes from my scripts. I am glad but I encountered a bug during heredoc parsing. Thanks to the CPAN, I tried 1.200 to 1.204_01 versions with the same result. Just try this script to reproduce the problem : -----8<----- #!/usr/local/bin/perl -w use strict; use PPI; my $document = PPI::Document->new($0); print $document->content; my $b = <<EOF; usage: $0 EOF my $a = "OK\n"; -----8<----- As you can see, the heredoc part is mistakenly removed... Thank you very much for your work and your help. Best regards, Max.
Download (untitled) / with headers
text/plain 402b
After looking the PPI::Token::HereDoc code, the heredoc token content is stored in 3 different attributes (content, _heredoc and _terminator_line). So the bug reported is not one. One must just use serialize() method instead of content() one to recover the original document form, as serialize() handles correctly heredoc and content() just returns content part... Sorry for the inconveniance, Max.
Thanks for leaving a note that this is not a bug. I'm closing this. :)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.