PERL PERL5 PORTERS 24 POD USAGE INSUFFICIENTLY PARANOID ABOUT CALLING PERLDOC
Date: Fri, 18 Feb 2005 13:18:48 -0500 (EST)

Subject: Pod::Usage insufficiently paranoid about calling "perldoc".
From: doughera@no-spam (Andy Dougherty)

While looking at the nifty new utils/corelist utility in 5.9.x, I tried to run it with -h. That emitted a brief message suggesting I try '-man' or '--man' instead. (The exact number of dashes to use is unclear, but irrelevant at the moment.) However,
$ ./perl -Ilib utils/corelist --man merely comes back empty and doesn't actually do anything.

The culprit, I think, is ultimately Pod::Usage, which does the following:

## Now translate the pod document and then exit with the desired status if ( $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"});
}

Of course, prior to installation, $scriptdir/perldoc doesn't necessarily exist.

Even after installation, however, $scriptdir/perldoc doesn't necessarily exist, though $scriptdir/perldoc5.9.2 does (since this is a devlopment release).

In either case, Pod::Usage probably ought to either check the return code from system() or check that $progpath actually exists before blindly calling it.

--
Andy Dougherty doughera@no-spam

Date: Fri, 18 Feb 2005 18:24:06 +0000

Subject: Re: Pod::Usage insufficiently paranoid about calling "perldoc".
From: steve.hay@no-spam (Steve Hay)
Andy Dougherty wrote:

>While looking at the nifty new utils/corelist utility in 5.9.x, I tried to >run it with -h. That emitted a brief message suggesting I try '-man' or >'--man' instead. (The exact number of dashes to use is unclear, but >irrelevant at the moment.) However,
> $ ./perl -Ilib utils/corelist --man >merely comes back empty and doesn't actually do anything.
>
>The culprit, I think, is ultimately Pod::Usage, which does the following:
>
> ## Now translate the pod document and then exit with the desired status > if ( $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"});
> }
>
>Of course, prior to installation, $scriptdir/perldoc doesn't >necessarily exist.
>
Coincidentally, I logged a CPAN RT request only the other day objecting to the use of perldoc at all for the manpage output, since it breaks programs after they are compiled with PAR:

http://rt.cpan.org/NoAuth/Bug.html?id=11525

- Steve
------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.



Date: Sat, 19 Feb 2005 02:48:07 -0500

Subject: Re: Pod::Usage insufficiently paranoid about calling "perldoc".
From: schwern@no-spam (Michael G Schwern)
On Fri, Feb 18, 2005 at 01:18:48PM -0500, Andy Dougherty wrote:
> In either case, Pod::Usage probably ought to either check the return > code from system() or check that $progpath actually exists before blindly > calling it.

It shouldn't be calling perldoc at all but rather use Pod::Perldoc->run which is all perldoc itself does these days. Lots of other core utilities probably need the same treatment.