[BUG:47:LOG] Dropped "and" in pod2man
authorHans Mulder <hans@icgned.nl>
Sun, 15 Jun 1997 11:26:49 +0000 (23:26 +1200)
committerTim Bunce <Tim.Bunce@ig.co.uk>
Wed, 6 Aug 1997 12:00:00 +0000 (00:00 +1200)
Nathan Torkington wrote:

> perlfunc.pod contains:

> For a yet-more-powerful import facility, see L</use> and
> L<perlmod>.

> when pod2man | nroff -man  has its way with this, it comes out as:

>                For a yet-more-powerful import facility, see the
>                use entry elsewhere in this document the perlmod
>                manpage.

> That is, the "and" is dropped.  I've verified this with the pod2man
> that comes with 5.004_01, but I couldn't produce a simple test case in
> 30 seconds.

This is about as simple as I could produce in 50 seconds:

=head1 NAME

foo - bar

=head1 DESCRIPTION

L</foo> and bar

This seems to help:

p5p-msgid: 9707082355.AA13254@ icgned.icgned.nl
private-msgid: 9707082355.AA13254@icgned.icgned.nl

pod/pod2man.PL

index 2c1837a..5ca0854 100644 (file)
@@ -1101,6 +1101,7 @@ sub clear_noremap {
 
 sub internal_lrefs {
     local($_) = shift;
+    local $trailing_and = s/and\s+$// ? "and " : "";
 
     s{L</([^>]+)>}{$1}g;
     my(@items) = split( /(?:,?\s+(?:and\s+)?)/ );
@@ -1114,6 +1115,7 @@ sub internal_lrefs {
 
     $retstr .= " entr" . ( @items > 1  ? "ies" : "y" )
            .  " elsewhere in this document "; # terminal space to avoid words running together (pattern used strips terminal spaces)
+    $retstr .=  $trailing_and;
 
     return $retstr;