pod updates from Tom Christiansen
[p5sagit/p5-mst-13.2.git] / lib / Pod / Man.pm
index 7a1c69f..87de42e 100644 (file)
@@ -1,5 +1,5 @@
 # Pod::Man -- Convert POD data to formatted *roff input.
-# $Id: Man.pm,v 0.5 1999/09/25 19:49:49 eagle Exp $
+# $Id: Man.pm,v 0.8 1999/10/07 09:39:37 eagle Exp $
 #
 # Copyright 1999 by Russ Allbery <rra@stanford.edu>
 #
@@ -28,7 +28,7 @@ use vars qw(@ISA %ESCAPES $PREAMBLE $VERSION);
 
 @ISA = qw(Pod::Parser);
 
-($VERSION = (split (' ', q$Revision: 0.5 $ ))[1]) =~ s/\.(\d)$/.0$1/;
+($VERSION = (split (' ', q$Revision: 0.8 $ ))[1]) =~ s/\.(\d)$/.0$1/;
 
 
 ############################################################################
@@ -518,14 +518,18 @@ sub sequence {
     my $command = $seq->cmd_name;
 
     # Zero-width characters.
-    if ($command eq 'Z') { return bless \ '\&', 'Pod::Man::String' }
+    if ($command eq 'Z') {
+       my $v = '\&'; return bless \ $v, 'Pod::Man::String';
+    }
 
     # C<>, L<>, X<>, and E<> don't apply guesswork to their contents.
     local $_ = $self->collapse ($seq->parse_tree, $command =~ /^[CELX]$/);
 
     # Handle E<> escapes.
     if ($command eq 'E') {
-        if (exists $ESCAPES{$_}) {
+        if (/^\d+$/) {
+            return bless \ chr ($_), 'Pod::Man::String';
+        } elsif (exists $ESCAPES{$_}) {
             return bless \ "$ESCAPES{$_}", 'Pod::Man::String';
         } else {
             carp "Unknown escape E<$1>";
@@ -552,7 +556,10 @@ sub sequence {
 
     # Handle links.
     if ($command eq 'L') {
-        return bless \ ($self->buildlink ($_)), 'Pod::Man::String';
+       # XXX bug in lvalue subroutines prevents this from working
+        #return bless \ ($self->buildlink ($_)), 'Pod::Man::String';
+        my $v = $self->buildlink($_);
+        return bless \$v, 'Pod::Man::String';
     }
                          
     # Whitespace protection replaces whitespace with "\ ".
@@ -745,7 +752,8 @@ sub buildlink {
         $text .= (length $manpage) ? " in $manpage"
                                    : " elsewhere in this document";
     } else {
-        $text .= 'the section on "' . $section . '"';
+        if ($section !~ /^".*"$/) { $section = '"' . $section . '"' }
+        $text .= 'the section on ' . $section;
         $text .= " in $manpage" if length $manpage;
     }
     $text;
@@ -984,7 +992,7 @@ Pod::Man is a module to convert documentation in the POD format (the
 preferred language for documenting Perl) into *roff input using the man
 macro set.  The resulting *roff code is suitable for display on a terminal
 using nroff(1), normally via man(1), or printing using troff(1).  It is
-conventionally invoked using the driver script B<pod2roff>, but it can also
+conventionally invoked using the driver script B<pod2man>, but it can also
 be used directly.
 
 As a derived class from Pod::Parser, Pod::Man supports the same methods and
@@ -1164,7 +1172,7 @@ B<pod2man> in Perl core.
 
 =head1 SEE ALSO
 
-L<Pod::Parser|Pod::Parser>, perlpod(1), pod2roff(1), nroff(1), troff(1),
+L<Pod::Parser|Pod::Parser>, perlpod(1), pod2man(1), nroff(1), troff(1),
 man(1), man(7)
 
 Ossanna, Joseph F., and Brian W. Kernighan.  "Troff User's Manual,"
@@ -1173,7 +1181,7 @@ the best documentation of standard nroff(1) and troff(1).  At the time of
 this writing, it's available at http://www.cs.bell-labs.com/cm/cs/cstr.html.
 
 The man page documenting the man macro set may be man(5) instead of man(7)
-on your system.  Also, please see pod2roff(1) for extensive documentation on
+on your system.  Also, please see pod2man(1) for extensive documentation on
 writing manual pages if you've not done it before and aren't familiar with
 the conventions.