Skip Menu |

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

Report information
The Basics
Id: 68157
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Pod-Parser

People
Owner: Nobody in particular
Requestors: jeff.holt [...] method-r.com
Cc:
AdminCc:

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



Subject: Pod-Parser-1.38/lib/Pod/Usage.pm question/bug
Date: Thu, 12 May 2011 15:55:40 -0500
To: bug-Pod-Parser [...] rt.cpan.org
From: Jeff Holt <jeff.holt [...] method-r.com>
I want to tell pod2usage the line width with which to format lines (e.g., with the width of the tty). I see no way of doing that with Usage.pm version 1.38 because on line 603 of Usage.pm the call to new its super isn't being passed any arguments that were given to new (via line 541). Here's what I propose line 603 is replaced with: my %opts; for (qw(alt indent margin loose sentence quotes code width)) { $opts{$_} = $params{USAGE_OPTIONS}{-$_} if defined $params{USAGE_OPTIONS}{-$_}; } $self = $self->SUPER::new(%opts); This list doesn't conflict with existing Usage.pm options, so I'm hopeful that you'll accept this humble request. I think I properly checked the inheritance for Usage.pm when $] is < 5.005_58 and it appears the inherited new comes from Pod::Parser via Pod::PlainText. In it's definition I find no problems with passing these options because they appear to be ignored also by Pod::Parser. So, I think it's a safe change to make. But do let me know if this won't work so I can figure out if I need to do something else. Thanks. Jeff BTW, I did make the above change and it seems to work just fine on perl 5.10.
Subject: Re: [rt.cpan.org #68157] AutoReply: Pod-Parser-1.38/lib/Pod/Usage.pm question/bug
Date: Mon, 16 May 2011 14:25:45 -0500
To: bug-Pod-Parser [...] rt.cpan.org
From: Jeff Holt <jeff.holt [...] method-r.com>
I just occurred to me that a more desirable solution is to modify Text::new instead of Usage::new: use Term::ReadKey; ... my ($termwidth) = Term::ReadKey::GetTerminalSize || 76; $$self{opt_width} = $termwidth unless defined $$self{opt_width}; On Thu, May 12, 2011 at 3:55 PM, Bugs in Pod-Parser via RT < bug-Pod-Parser@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Pod-Parser-1.38/lib/Pod/Usage.pm question/bug", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #68157]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=68157 > > Please include the string: > > [rt.cpan.org #68157] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-Pod-Parser@rt.cpan.org > > ------------------------------------------------------------------------- > I want to tell pod2usage the line width with which to format lines (e.g., > with the width of the tty). I see no way of doing that with Usage.pm > version > 1.38 because on line 603 of Usage.pm the call to new its super isn't being > passed any arguments that were given to new (via line 541). > > Here's what I propose line 603 is replaced with: > > my %opts; > for (qw(alt indent margin loose sentence quotes code width)) { > $opts{$_} = $params{USAGE_OPTIONS}{-$_} if defined > $params{USAGE_OPTIONS}{-$_}; > } > $self = $self->SUPER::new(%opts); > > This list doesn't conflict with existing Usage.pm options, so I'm hopeful > that you'll accept this humble request. > > I think I properly checked the inheritance for Usage.pm when $] is < > 5.005_58 and it appears the inherited new comes from Pod::Parser via > Pod::PlainText. In it's definition I find no problems with passing these > options because they appear to be ignored also by Pod::Parser. So, I think > it's a safe change to make. But do let me know if this won't work so I can > figure out if I need to do something else. > > Thanks. > > Jeff > > BTW, I did make the above change and it seems to work just fine on perl > 5.10. > >
Applied to 1.50, in slightly different form, thanks for the suggestion. To be released soon.