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.