Skip Menu |

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

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

People
Owner: Marek.Rouchal [...] gmx.net
Requestors: David.Purdie [...] erggroup.com
djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.30
  • 1.31
  • 1.32
  • 1.33
  • 1.34
  • 1.35
Fixed in: 1.36



Subject: Three bugs in Pod::Usage Version 1.35
Date: Wed, 27 Aug 2008 10:41:43 +0800
To: <bug-Pod-Parser [...] rt.cpan.org>
From: David Purdie <David.Purdie [...] erggroup.com>
Download UsageBugs.zip
application/zip 962b

Message body not shown because it is not plain text.

Distribution Name: Pod-Parser-1.35 Perl Version : v5.10.0 built for MSWin32-x86-multi-thread ( But not relevant to these bugs) OS : Cygwin, Solaris, Linux - bugs are OS independent Bug 1: Use of -section in Pod::Usage does not correctly pickup head1 sections If a =head1 section contains an =head2, then this will prevent the correct processing of following =head1 sections because the USAGE_HEAD2 variable is not reset Fix: File; Usage.pm line sub _handle_element_end { my ($self, $element) = @_; if ($element eq 'head1') { $$self{USAGE_HEAD1} = $$self{PENDING}[-1][1]; $$self{USAGE_HEAD2} = undef; # FIX Bug 2: Use of -section in Pod::Usage and =over,=back The use of =over and =back in sections that are not selected with a -section will cause the display of =items in a selected section to be incorrectly located. When -section is used then the =over operations are processed, but the =back is ignored. The fix also corrects the operation of elements like =item B<This is in bold> Fix: File: Usage.pm Sub: _handle_element_end() Broken: if ($$self{USAGE_SKIPPING}) { pop @{ $$self{PENDING} }; } else { $self->SUPER::_handle_element_end($element); } Fixed: if ($$self{USAGE_SKIPPING} && $element !~ m/^over-/) { pop @{ $$self{PENDING} }; } else { $self->SUPER::_handle_element_end($element); } Bug 3: Use of -section in Pod::Usage. Can't define multiple sections Only one RE can be passed to the Pod::Usage selector logic. Forcing the user to use one RE doesn't allow the looping of the test against the array of USAGE_SELECT elements. The code works with an array - it just can't get passed in. Fix enhance the Usage API to allow: -sections => 'fred' -sections => [ 'fred', 'fred/subsection' ]; Fix File; Usage.pm Function: pod2usage elsif ($opts{"-verbose"} == 99) { my $sections = $opts{"-sections"}; $parser->select( (ref $sections ) ? @{$sections} : $sections ); $opts{"-verbose"} = 1; } Files; Examples of the three bugs Hope all of this helps create a better module. David Purdie -------------------------------------------------------------------------------------------------------------- ERG Transit Systems 247 Balcatta Road Balcatta WA 6021 Australia Website: www.erggroup.com Tel: + 61 8 9273 1204 mailto:dpurdie@erggroup.com The contents of this email and any attachments are confidential and may only be read by the intended recipient This email is confidential. If you are not the intended recipient you must not disclose or use the information contained in it. If you have received this email in error please notify us immediately by return email and delete this email and any attachments. ERG is not responsible for any changes made to this email or any attachments, other than those made by ERG, or for the effect of the changes on the meaning of the email or any attachments. ERG accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.
Subject: Pod::Usage, verbosity=1 ignores OPTIONS if preceded by DESCRIPTION with subsections
If the OPTIONS AND ARGUMENTS section is preceded by a DESCRIPTION section with subsections (=head2), verbosity=1 will ignore the OPTIONS AND ARGUMENTS section. If the =head2 is removed, or the DESCRIPTION section is moved after OPTIONS AND ARGUMENTS verbosity=1 works. To see this, run pod2usage --verbose 1 test.pod on the attached file. Thanks, Diab
Subject: test.pod
=head1 NAME wikiup - upload content to a topic on a Foswiki or TWiki wiki site. =head1 SYNOPSIS wikiup [options] destination files... =head1 DESCRIPTION =head2 Specifying the destination topic =head1 OPTIONS AND ARGUMENTS The required arguments (which typically follow any options on the command line) are:
Many thanks for the suggestions - will be included in Pod-Parser-1.36. -Marek
This is fixed with #38747 which will be included in Pod-Parser-1.36. -Marek
Fixed in Pod-Parser-1.36.