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: 20647
Status: resolved
Priority: 0/
Queue: PPI

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

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



MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 376
Download (untitled) / with headers
text/plain 376b
PPI can't handle <<HERE_DOCs. #!/usr/bin/perl use Test::More tests => 1; use PPI; my $src = <<'TEXT'; print <<'BAR'; Here is some text BAR TEXT is( PPI::Document->new( \$src ), $src ) 1..1 not ok 1 # Failed test in tmp/ppi at line 10. # got: 'print <<'BAR'; # ' # expected: 'print <<'BAR'; # Here is some text # BAR # ' # Looks like you failed 1 test of 1.
X-Scanned-BY: AMaViS-ng at bestpractical
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
In-Reply-To: <rt-3.6.HEAD-20407-1153757257-99.20647-4-0 [...] rt.cpan.org>
Received-SPF: neutral (x1.develooper.com: local policy)
References: <RT-Ticket-20647 [...] rt.cpan.org> <rt-3.6.HEAD-20407-1153757257-99.20647-4-0 [...] rt.cpan.org>
X-Virus-Scanned: amavisd-new at systechtelecom.net
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
Received: from localhost (diesel.bestpractical.com [127.0.0.1]) by diesel.bestpractical.com (Postfix) with ESMTP id 83CA04D8129 for <cpan-bug+ppi [...] diesel.bestpractical.com>; Mon, 24 Jul 2006 12:14:06 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 1E7384D80A7 for <bug-PPI [...] rt.cpan.org>; Mon, 24 Jul 2006 12:14:05 -0400 (EDT)
Received: (qmail 3277 invoked by alias); 24 Jul 2006 16:14:05 -0000
Received: from wcdcip8.systechtelecom.net (HELO mail.systechtelecom.net) (220.232.171.8) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 24 Jul 2006 09:14:02 -0700
Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.systechtelecom.net (Postfix) with ESMTP id BE9A387809E for <bug-PPI [...] rt.cpan.org>; Tue, 25 Jul 2006 00:13:53 +0800 (HKT)
Received: from mail.systechtelecom.net ([127.0.0.1]) by localhost (mail.systechtelecom.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mKm+BwzTKEfd for <bug-PPI [...] rt.cpan.org>; Tue, 25 Jul 2006 00:13:51 +0800 (HKT)
Received: from [10.24.144.55] (unknown [203.125.75.82]) by mail.systechtelecom.net (Postfix) with ESMTP id ED7D587808A for <bug-PPI [...] rt.cpan.org>; Tue, 25 Jul 2006 00:13:50 +0800 (HKT)
Delivered-To: cpan-bug+ppi [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #20647]
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
Return-Path: <adam [...] phase-n.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+ppi [...] diesel.bestpractical.com
Date: Tue, 25 Jul 2006 00:13:50 +0800
Message-Id: <44C4F1BE.4080301 [...] phase-n.com>
To: bug-PPI [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Adam Kennedy <adam [...] phase-n.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-20396-1153757654-1050.20647-0-0 [...] rt.cpan.org>
Content-Length: 929
Download (untitled) / with headers
text/plain 929b
The test code is invalid, documents stringify naively. The correct test code is is( PPI::Document->new( \$src )->serialize, $src ); Adam K via RT wrote: Show quoted text
> Mon Jul 24 12:07:35 2006: Request 20647 was acted upon. > Transaction: Ticket created by JJORE > Queue: PPI > Subject: (No subject given) > Broken in: 1.115 > Severity: Important > Owner: Nobody > Requestors: JJORE@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=20647 > > > > PPI can't handle <<HERE_DOCs. > > #!/usr/bin/perl > use Test::More tests => 1; > use PPI; > my $src = <<'TEXT'; > print <<'BAR'; > Here is some text > BAR > TEXT > > is( PPI::Document->new( \$src ), $src ) > > > 1..1 > not ok 1 > # Failed test in tmp/ppi at line 10. > # got: 'print <<'BAR'; > # ' > # expected: 'print <<'BAR'; > # Here is some text > # BAR > # ' > # Looks like you failed 1 test of 1.
X-Scanned-BY: AMaViS-ng at bestpractical
CC: JJORE [...] cpan.org
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.4 required=8.0 tests=BAYES_00,DK_SIGNED,DK_VERIFIED,DNS_FROM_RFC_ABUSE,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-20396-1153757654-1050.20647-6-0 [...] rt.cpan.org>
Content-Disposition: inline
Received-SPF: pass (x1.develooper.com: domain of twists [...] gmail.com designates 64.233.166.176 as permitted sender)
References: <RT-Ticket-20647 [...] rt.cpan.org> <rt-3.6.HEAD-20407-1153757257-99.20647-4-0 [...] rt.cpan.org> <44C4F1BE.4080301 [...] phase-n.com> <rt-3.6.HEAD-20396-1153757654-1050.20647-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: ISO-8859-1
Received: from localhost (diesel.bestpractical.com [127.0.0.1]) by diesel.bestpractical.com (Postfix) with ESMTP id 8131B4D8155 for <cpan-bug+ppi [...] diesel.bestpractical.com>; Mon, 24 Jul 2006 13:20:19 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 3C7954D8129 for <bug-PPI [...] rt.cpan.org>; Mon, 24 Jul 2006 13:20:19 -0400 (EDT)
Received: (qmail 31128 invoked by alias); 24 Jul 2006 17:20:18 -0000
Received: from py-out-1112.google.com (HELO py-out-1112.google.com) (64.233.166.176) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 24 Jul 2006 10:20:15 -0700
Received: by py-out-1112.google.com with SMTP id s49so2424558pyc for <bug-PPI [...] rt.cpan.org>; Mon, 24 Jul 2006 10:19:36 -0700 (PDT)
Received: by 10.35.70.2 with SMTP id x2mr7931264pyk; Mon, 24 Jul 2006 10:19:36 -0700 (PDT)
Received: by 10.35.124.10 with HTTP; Mon, 24 Jul 2006 10:19:36 -0700 (PDT)
Delivered-To: cpan-bug+ppi [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #20647]
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PEQhB+IS6DyUU7ALUsBDSbgoz2C++73UNR0k1YZT2ny+Gx6SlF8FWFGeT3Uaduy0b0jP7XR1sAeeFig8s3iE/XrUYTJSvYmJs48sbZzLVQa8hM5SQvLf7m16qO2tCKBXHtSSJs4ySrtFniPOpHaWApkLaeeLi4uVkSdJ0iXkr4k=
Return-Path: <twists [...] gmail.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+ppi [...] diesel.bestpractical.com
Date: Mon, 24 Jul 2006 12:19:36 -0500
Message-Id: <dc5c751d0607241019n28f656act132d184daa76ea39 [...] mail.gmail.com>
To: bug-PPI [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: "Joshua ben Jore" <twists [...] gmail.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-20323-1153761624-1566.20647-0-0 [...] rt.cpan.org>
Content-Length: 644
Download (untitled) / with headers
text/plain 644b
On 7/24/06, adam@phase-n.com via RT <bug-PPI@rt.cpan.org> wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=20647 > > > The test code is invalid, documents stringify naively. > > The correct test code is > > is( PPI::Document->new( \$src )->serialize, $src );
Ah. Perl::Critic was using the overloaded "" stringification which triggered this. I saw the same behavior in PPI and figured it was PPI's problem. I didn't realize the overloaded "" was producing wrong output just because it wasn't named ->serialize. Is there a good reason to overload "" to ->content()? I'd think it'd be more correct to overload to ->serialize(). Josh
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-20323-1153761624-1566.20647-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-447-1157029750-1604.20647-0-0 [...] rt.cpan.org>
References: <RT-Ticket-20647 [...] rt.cpan.org> <rt-3.6.HEAD-20407-1153757257-99.20647-4-0 [...] rt.cpan.org> <44C4F1BE.4080301 [...] phase-n.com> <rt-3.6.HEAD-20396-1153757654-1050.20647-6-0 [...] rt.cpan.org> <dc5c751d0607241019n28f656act132d184daa76ea39 [...] mail.gmail.com> <rt-3.6.HEAD-20323-1153761624-1566.20647-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1097
On Mon Jul 24 13:20:24 2006, twists@gmail.com wrote: Show quoted text
> On 7/24/06, adam@phase-n.com via RT <bug-PPI@rt.cpan.org> wrote:
> > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=20647 > > > > > The test code is invalid, documents stringify naively. > > > > The correct test code is > > > > is( PPI::Document->new( \$src )->serialize, $src );
> > Ah. Perl::Critic was using the overloaded "" stringification which > triggered this. I saw the same behavior in PPI and figured it was > PPI's problem. I didn't realize the overloaded "" was producing wrong > output just because it wasn't named ->serialize. > > Is there a good reason to overload "" to ->content()? I'd think it'd > be more correct to overload to ->serialize(). > > Josh
When treated as a simple string, you can't fully serialize validly. You can ONLY do it when you fully output to a file (due to the nature of the way here-doc content works). So for the moment, no I'm keeping it as content, mostly because if I change it to serialize, it means that a document stringifies differently to an element. And I'm dubious about that.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-433-1157029832-362.20647-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 7
WONTFIX


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.