Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: srj [...] unc.edu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.35
Fixed in: 1.36



Subject: Sometimes -msg ignored with -version >= 2
Perl 10.8.8 - Mac OS X 10.5.2 (Intel) - Perl::Usage 1.35 Tried to use perl2usage(...) with a "preceding message", but it wasn't working. Figured out this happens whenever the "MAN" type output is generated, but it is not clear from the documentation when this "MAN" output will happen. It only happens SOME of the time when -verbose is set to 2 or more, such as when the output is set to STDERR (see attached file). I believe the inconsistency is rooted in the following if/then/else block. ## Now translate the pod document and then exit with the desired status if ( !$opts{"-noperldoc"} and $opts{"-verbose"} >= 2 and !ref($opts{"-input"}) and $opts{"-output"} == \*STDOUT ) { ## spit out the entire PODs. Might as well invoke perldoc my $progpath = File::Spec->catfile($Config{scriptdir}, "perldoc"); system($progpath, $opts{"-input"}); if($?) { # RT16091: fall back to more if perldoc failed system($ENV{PAGER} || 'more', $opts{"-input"}); } } else { $parser->parse_from_file($opts{"-input"}, $opts{"-output"}); } This was especially problematic for me to diagnose as I am programming with Eclipse/EPIC, and the internal run console never generates MAN style pages, only POD formated ones. The message was sometimes showing up, and sometimes not. However, the inconsistent behavior descried in the initial paragraphs and in the attached file is not related to the development environment, but occurs directly in a (bash) shell. Either documentation should be changed to more clearly reflect the "MAN" vs "POD" formatting issues, or make the formatting more consistent. Perhaps a setting to print "ALL POD" or "MAN" explicitly? Note: I checked the CPAN test (pod2usage2.t), but it doesn't cover used the combination of parameters that output the "MAN" type pages (the first "if" path, in the above code).
Subject: testPerl2Usage
Download testPerl2Usage
application/octet-stream 639b

Message body not shown because it is not plain text.

Thanks for the hint. All I had to do is to add a print of the message in front of the call to perldoc. The only downside is that perldoc usually calls a pager, which means that the message scrolls off the screen, but there is little one can do about that, without dropping the nice formatting done by perldoc. Change to be included in Pod-Parser-1.36. Let me know if that suits your needs. -Marek
I just checked - you are right, that branch is not covered; that's however because the formatting of the POD by perldoc is extremely dependent on the platform, and I cannot robustly check that. Sorry. -Marek