Skip Menu |

This queue is for tickets about the Pod-Parser CPAN distribution.

Report information
The Basics
Id: 17997
Status: resolved
Priority: 0/
Queue: Pod-Parser

People
Owner: Marek.Rouchal [...] gmx.net
Requestors: chris+rt [...] chrisdolan.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.33
  • 1.34
Fixed in: 1.35



Subject: Regression: -input no longer works with __DATA__ with -verbose => 2
The following short program works under Pod::Usage 1.16 but fails under Pod::Usage 1.33. Under the latter, it generates no output. I've been using the __DATA__ trick to work with PAR for over a year. -- Chris use Pod::Usage; pod2usage(-verbose => 2, -input => \*DATA); __DATA__ =head1 NAME Test =head1 SYNOPSIS perl podusagetest.pl =head1 DESCRIPTION This is a test.
Sorry - can't reproduce this problem with any PP 1.30...1.34. Please check carefully which Pod::Parser and Pod::Usage versions you are using.
On Sun Sep 10 15:25:04 2006, MAREKR wrote: Show quoted text
> Sorry - can't reproduce this problem with any PP 1.30...1.34. Please > check carefully which Pod::Parser and Pod::Usage versions you are using.
Hmm... Thanks for looking. I've discovered that __DATA__ is not a requirement -- the bug is generalized to any filehandle passed via "-input". Attached is an updated test case that fails on Mac OS X 10.4, Perl 5.8.6. Specifying a "-output" does not help. Also attached is output from setting Pod::Simple::DEBUG to 2. % perl -le'for(@ARGV){eval "require $_"; print "$_ ".$_->VERSION}' Pod::Usage Pod::Parser Pod::Text Pod::PlainText Pod::Simple Pod::Usage 1.33 Pod::Parser 1.32 Pod::Text 3.07 Pod::PlainText 2.02 Pod::Simple 3.04 % cpanp i Pod::Usage [MSG] Checking if source files are up to date [MSG] Retrieving /Users/chris/.cpanplus/sourcefiles.2.15.stored Installing Pod::Usage [MSG] Module 'Pod::Usage' already up to date, won't install without force Module 'Pod::Usage' installed successfully No errors installing all modules % perl -v This is perl, v5.8.6 built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail)
BEGIN { #sub Pod::Simple::DEBUG() { 2 } } use Pod::Usage; use strict; use warnings; my $fh; open $fh, $0 or die; pod2usage(-verbose => 2, -input => $fh); =head1 NAME Test =head1 SYNOPSIS perl podusagetest.pl =head1 DESCRIPTION This is a test. =cut
Download podusagetest.pl.out
application/octet-stream 2.3k

Message body not shown because it is not plain text.

Subject: RE: [rt.cpan.org #17997] Regression: -input no longer works with __DATA__ with -verbose => 2
Date: Mon, 11 Sep 2006 17:04:46 +0200
To: <bug-Pod-Parser [...] rt.cpan.org>
From: <marek.rouchal [...] infineon.com>
Argh - this seems to be a MAC-OS specific issue; no-one reported anything comparable on other platforms. Unless you can find the root cause and can submit a patch, I am afraid there is little I can do for you :-/ since I do not have access to a MAC. -Marek
On Mon Sep 11 11:12:20 2006, marek.rouchal@infineon.com wrote: Show quoted text
> Argh - this seems to be a MAC-OS specific issue; no-one > reported anything comparable on other platforms. > Unless you can find the root cause and can submit a patch, > I am afraid there is little I can do for you :-/ > since I do not have access to a MAC. > > -Marek
I've reproduced the problem on FreeBSD 5.4. However, I was not able to reproduce until I had the following installed: Pod::Usage 1.33 Pod::Parser 1.32 Pod::Text 3.07 Pod::PlainText 2.02 Pod::Simple 3.04 With the following, the problem did not manifest: Pod::Usage 1.33 Pod::Parser 1.32 Pod::Text 2.21 Pod::PlainText 2.02 Pod::Simple So, it looks like the problem is instead with Pod::Text or Pod::Simple, not specifically with Pod::Usage/Pod::Parser. -- Chris
From: CLOTHO [...] cpan.org
The attached patch to Pod::Usage fixes this bug for me. The problem was that with -verbose => 2, there is no selected section. Thus all sections are skipped. I have no idea how this code ever worked! :-) Chris
--- /Users/chris/perl/System/Library/Perl/5.8.6/Pod/Usage.pm 2005-09-05 15:11:25.000000000 -0500 +++ lib/Pod/Usage.pm 2006-10-25 11:30:15.000000000 -0500 @@ -601,10 +601,14 @@ $$self{USAGE_SKIPPING} = 1; my $heading = $$self{USAGE_HEAD1}; $heading .= '/' . $$self{USAGE_HEAD2} if defined $$self{USAGE_HEAD2}; - for (@{ $$self{USAGE_SELECT} }) { - if ($heading =~ /^$_\s*$/) { - $$self{USAGE_SKIPPING} = 0; - last; + if (!$$self{USAGE_SELECT} || !@{ $$self{USAGE_SELECT} }) { + $$self{USAGE_SKIPPING} = 0; + } else { + for (@{ $$self{USAGE_SELECT} }) { + if ($heading =~ /^$_\s*$/) { + $$self{USAGE_SKIPPING} = 0; + last; + } } }
Fixed in 1.35