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)



Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 574694DCFC8 for <bug-PPI [...] rt.cpan.org>; Mon, 27 Apr 2009 10:29:18 -0400 (EDT)
Received: (qmail 27627 invoked by uid 103); 27 Apr 2009 14:29:17 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 27 Apr 2009 14:29:17 -0000
Received: from smtp5-g21.free.fr (HELO smtp5-g21.free.fr) (212.27.42.5) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 27 Apr 2009 07:29:10 -0700
Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id 220F4D48190; Mon, 27 Apr 2009 16:29:01 +0200 (CEST)
Received: from auber.mobigard.com (local.mobigard.com [88.161.118.105]) by smtp5-g21.free.fr (Postfix) with ESMTP id E48B5D4801C; Mon, 27 Apr 2009 16:28:58 +0200 (CEST)
Delivered-To: cpan-bug+PPI [...] diesel.bestpractical.com
Subject: PPI bug
MIME-Version: 1.0
User-Agent: Thunderbird 2.0.0.21 (X11/20090326)
X-Spam-Status: No, hits=0.0 required=8.0 tests=
Return-Path: <max [...] scoubidou.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-PPI [...] rt.cpan.org
Date: Mon, 27 Apr 2009 16:28:58 +0200
X-Spam-Level: *
content-type: text/plain; charset="utf-8"; format="flowed"
Message-ID: <49F5C12A.1060709 [...] scoubidou.com>
To: bug-PPI [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Maxime Soulé <max [...] scoubidou.com>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 574
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.
MIME-Version: 1.0
In-Reply-To: <49F5C12A.1060709 [...] scoubidou.com>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <49F5C12A.1060709 [...] scoubidou.com>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-10159-1240844938-1931.45471-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 402
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.
MIME-Version: 1.0
In-Reply-To: <49F5C12A.1060709 [...] scoubidou.com>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <49F5C12A.1060709 [...] scoubidou.com>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-24817-1415796819-625.45471-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 70
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.