develooper Front page | perl.perl5.porters | Postings from October 2005

[perl #36967] Pod/Perldoc.pm bug with -m switch

From:
Steve Peters via RT
Date:
October 1, 2005 21:33
Subject:
[perl #36967] Pod/Perldoc.pm bug with -m switch
Message ID:
rt-3.0.11-36967-121880.7.28722654109021@perl.org
> [bepi@perl.it - Wed Aug 31 01:42:41 2005]:
> 
> On Mon, 22 Aug 2005 10:41:15 -0600
> Jim Cromie <jcromie@divsol.com> wrote:
> 
> Hi Jim,
> 
> > >>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.
> 
> I agree with this, but one can check also for Foo.pod after checking
> Foo.pm, not
> disabling that at all.
> Currently, if Foo.pm isn't found, there is no chanche to check also
> Foo.pod
> again (in the same path).
> 
> Attached patch maintains precedence of .pm over .pod (in order to
> looking at the
> code first with -m switch) but also check for .pod suffix then.
> 
> > this may also be reason for looking in pods/*
> 
> In general, putting pure pod under pod/pods dedicated directory is a
> good thing
> (and IMHO it should be the rule) but is poorly documented and/or
> suggested.
> 

This is not a problem.  Looking at the complete manpage for perldoc
gives alternatives.  It I want to see the raw Pod for a C<.pod> file,
you can do a 

    perldoc -u lwpcook

The manpage is very clear, however, that the C<-m> flag is to be
followed by a module.  Since a C<.pod> file is not a module, it will not
be found or displayed.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About