Enrico Sorcinelli wrote:

On Sun, 21 Aug 2005 20:28:40 -0700
"Steve Peters via RT" <[EMAIL PROTECTED]> wrote:

Hi Steve,

[bepi - Sat Aug 20 15:45:51 2005]:

This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.35 running under perl v5.8.7.

Pod/Perldoc.pm adds also .pod extension (to perldoc argument) only if:

1) -m switch hasn't been specified

or

2) for 'pod/' or 'pods/' subdirectories (even if -m switch has been
specified).

Sincerely, I don't know if there's a directive and/or specification
and/or a
reason that suggests to put *.pod files (shipped in a distribution)
into a pod/
or pods/ subdirectory, but there are many CPAN modules that don't do
it! :-)

So for example:

        %> perldoc -m perlboot

works well (in general with all core pods, since them lives under
pods/
directory), but:

        %> perldoc -m lwpcook

doesn't work (with the last you must have LWP installed in your
system).

IMHO, 1) and 2) conditions are a nonsense together.

I've included a simple patch over Pod/Perldoc.pm 3.14 for checking
also .pod (indipendently from -m switch presence).

Regards

        - Enrico

I'm not sure that this is a problem. Looking at perldoc -h,
       -m   Display module's file in its entirety

A POD file, is not, however, a module.  So, when I try "perldoc -m
lwpcook" it fails since no lwpcook.pm file exists.

From the point of view of Pod/Perldoc.pm there's no differences between .pod or
.pm files or, more in general, between a generic file or Perl module.
For example, I can view the source of 'media.types' file shipped with LPW:

        %> perldoc -m LWP::media.types

The bug (or 'strange' behaviour if you prefere) I've noted is that
Pod/Perldoc.pm adds .pod extension to perldoc argument only under certain (and,
in this case, inconsistent) circumstances and still I don't understand why.

I think the biggest reason is if you have both Foo.pm and Foo.pod
your previous patch (I think) will prefer Foo.pod, making Foo.pm unavailable.
this may also be reason for looking in pods/*

When I try "perldoc
-m lwpcook.pm", the file is found right away and displayed.

Umh...

        %> perldoc -m lwpcook.pm

doesn't work for me! Are you sure? There's not a lwpcook.pm file in my LPW
(5.803) installation. BTW, with Pod/Perldoc.pm 3.14 this cannot work at all.
There's not magical attempt to search for alternative extensions if that one
provided were not found (perhaps could be an idea...?).
Alternative extensions (.pod, .pm, .com, .bat and so one) are only *added* to
perldoc filename argument.

Regards

        - Enrico

for me, most of these work:

[EMAIL PROTECTED] vref]$ perldoc lwpcook
[EMAIL PROTECTED] vref]$ perldoc lwpcook.pod
[EMAIL PROTECTED] vref]$ perldoc -m lwpcook
No module found for "lwpcook".
[EMAIL PROTECTED] vref]$ perldoc -m lwpcook.pod

as Steve suggested, -m is mostly for looking at the code (wo typing a path)
for that, the current behavior is ok.

if you want -m so you can see pod formatting tricks, then its inconvenient,
but with an easy workaround (add the .pod suffix)

given the larger problem of *.pod vs *.pm ambiguities/preferences with your patch, Id be concerned about having the pm hidden from me, and my not even knowing it.

Reply via email to