Skip Menu |

This queue is for tickets about the Prima CPAN distribution.

Report information
The Basics
Id: 83226
Status: resolved
Priority: 0/
Queue: Prima

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.36
Fixed in: (no value)



Subject: podview L<> external vs section
Date: Sat, 09 Feb 2013 07:36:40 +1100
To: bug-Prima [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
If a pod document contains a section name which is the same as an external module name then in podview clicking on an L<Foo> link goes to the section rather than the module. I hoped L<Foo> would mean a module. The sample link.pod below shows the problem. The link L<Carp> goes to the section "Carp" where I hoped for the module Carp. I believe in the past L<Foo> was allowed to mean an internal link to a section, the same as L</Foo> has always meant, but that now L<Foo> should generally be taken to be external and only L</Foo> or L<"Foo"> for internal. The last bullet point of "About L<...> Codes" in perlpodspec.pod discusses this.
=head1 BLAH blah blah =head1 Carp blah blah =head1 SEE ALSO See module L<Carp>. See section L</Carp>.
This bug is a problem for reading the Moose::Manual with podview because it has a table of contents in exactly the form described above.  For example: just try 'podview Moose::Manual' and then click on one of the entries in the TOC like 'Moose::Manual::Roles'.

Looking at the descriptions of L<> in perlpod of my v5.14.2 perl shows that a link entry containing no /'s or |' should be a perl manual page.  When I change the regex to find the page at line 313 to:

...
313                 if ( $s =~ /^(?:file:\/\/)?(.*)$/) {
314                         $page = $1;
...

Then the link following in podview works as expected.  Unfortunately, it doesn't work from the command line now because the podview command starts by appending a '/' to the end of the heading before it calls open_help().

I don't understand the logic but it seems I'm missing some assumption about how things work and why a '/' is appended all the time even to a perl module name.


The attached file is a patch against Prima-1.36 that appears to resolved the problem.  Apologies for any lack of sophistication.
Subject: prima-podview.patch
--- PodView.pm 2013-03-20 17:29:31.780697400 -0400 +++ xx/Prima-1.36/Prima/PodView.pm 2012-09-12 15:47:16.000000000 -0400 @@ -310,8 +310,6 @@ if ( $s =~ /^file:\/\/(.*)$/) { $page = $1; - } elsif ( $s =~ m{^([:\w]+)/?$} ) { - $page = $1; } elsif ( $s =~ /^([^\/]*)(\/)(.*)$/) { ( $page, $lead_slash, $section) = ( $1, $2, $3); } else {
Hi Chris, I trust you on the correctness of interpretation of the current pod syntax, and have just added the patch - thank you! However I also added some unrelated fixes, so I'd kindly like to ask you to check if the latest Prima from github works for you. Thank you! /dk
Subject: Re: [rt.cpan.org #83226] podview L<> external vs section
Date: Sat, 06 Apr 2013 09:48:51 +1100
To: bug-Prima [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"KARASIK via RT" <bug-Prima@rt.cpan.org> writes: Show quoted text
> > latest Prima from github works for you.
That seems right for me.