[PATCH] Use of -section in Pod::Usage and =over,=back

Niko Tyni ntyni at debian.org
Sun Mar 15 19:42:25 UTC 2009


Quoting David Purdie in [rt.cpan.org #41136]:

> 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>

The patch is included in Pod-Parser-1.36.
---
 lib/Pod/Usage.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Pod/Usage.pm b/lib/Pod/Usage.pm
index cbb55c5..56958c0 100644
--- a/lib/Pod/Usage.pm
+++ b/lib/Pod/Usage.pm
@@ -631,7 +631,7 @@ sub _handle_element_end {
             $$self{PENDING}[-1][1] = $_;
         }
     }
-    if ($$self{USAGE_SKIPPING}) {
+    if ($$self{USAGE_SKIPPING} && $element !~ m/^over-/) {
         pop @{ $$self{PENDING} };
     } else {
         $self->SUPER::_handle_element_end($element);
-- 
1.5.6.5


--u3/rZRmxL6MmkK24--






More information about the Perl-maintainers mailing list