perldoc: allow arguments for pager
[p5sagit/p5-mst-13.2.git] / utils / perldoc.PL
index 8cfd496..81e270c 100644 (file)
@@ -42,7 +42,7 @@ INIT { eval { umask(0077) } }   # doubtless someone has no mask
 $Config{pager}
 /../
 my \@pagers = ();
-push \@pagers, \$pager if -x \$pager;
+push \@pagers, \$pager if -x (split /\\s+/, \$pager)[0];
 
 (my \$bindir = <<'/../') =~ s/\\s*\\z//;
 $Config{scriptdirexp}
@@ -109,7 +109,7 @@ Options:
     -r   Recursive search (slow)
     -i   Ignore case
     -t   Display pod using pod2text instead of pod2man and nroff
-             (-t is the default on win32)
+             (-t is the default on win32 unless -n is specified)
     -u  Display unformatted pod text
     -m   Display module's file in its entirety
     -n   Specify replacement for nroff
@@ -123,9 +123,8 @@ Options:
 PageName|ModuleName...
          is the name of a piece of documentation that you want to look at. You
          may either give a descriptive name of the page (as in the case of
-         `perlfunc') the name of a module, either like `Term::Info',
-         `Term/Info', the partial name of a module, like `info', or
-         `makemaker', or the name of a program, like `perldoc'.
+         `perlfunc') the name of a module, either like `Term::Info' or like
+         `Term/Info', or the name of a program, like `perldoc'.
 
 BuiltinFunction
          is the name of a perl function.  Will extract documentation from
@@ -198,8 +197,6 @@ if (!($Is_VMS || $Is_MSWin32 || $Is_Dos || $Is_OS2) && ($> == 0 || $< == 0)
     die "Superuser must not run $0 without security audit and taint checks.\n";
 }}
 
-$opt_n = "nroff" if !$opt_n;
-
 my $podidx;
 if ($opt_X) {
     $podidx = "$Config{'archlib'}/pod.idx";
@@ -213,11 +210,13 @@ elsif ($Is_MSWin32
        || $Is_Dos
        || !($ENV{TERM} && $ENV{TERM} !~ /dumb|emacs|none|unknown/i))
 {
-    $opt_t = 1 unless $opts;
+    $opt_t = 1 unless ( $opts || $opt_n );
 }
 
 if ($opt_t) { require Pod::Text; import Pod::Text; }
 
+$opt_n = "nroff" if !$opt_n;
+
 my @pages;
 if ($opt_f) {
     @pages = ("perlfunc");
@@ -760,10 +759,7 @@ run.
 
 The item you want to look up.  Nested modules (such as C<File::Basename>)
 are specified either as C<File::Basename> or C<File/Basename>.  You may also
-give a descriptive name of a page, such as C<perlfunc>. You may also give a
-partial or wrong-case name, such as "basename" for "File::Basename", but
-this will be slower, if there is more then one page with the same partial
-name, you will only get the first one.
+give a descriptive name of a page, such as C<perlfunc>.
 
 =back
 
@@ -783,7 +779,7 @@ One useful value for C<PERLDOC_PAGER> is C<less -+C -E>.
 
 =head1 VERSION
 
-This is perldoc v2.03.
+This is perldoc v2.04.
 
 =head1 AUTHOR
 
@@ -795,6 +791,9 @@ and others.
 =cut
 
 #
+# Version 2.04: Sun Aug 18 13:27:12 BST 2002
+#   Randy W. Sims <RandyS@ThePierianSpring.org>
+#   allow -n to enable nroff under Win32
 # Version 2.03: Sun Apr 23 16:56:34 BST 2000
 #      Hugo van der Sanden <hv@crypt0.demon.co.uk>
 #      don't die when 'use blib' fails