hand apply whitespace mutiliated perldoc.PL patches
authorRobin Barker <RMBarker@cpan.org>
Tue, 23 Jun 1998 15:49:52 +0000 (16:49 +0100)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 28 Jun 1998 17:05:59 +0000 (17:05 +0000)
Date: Tue, 23 Jun 98 15:49:52 BST
Message-Id: <5302.9806231449@tempest.cise.npl.co.uk>
Subject: PATCH [5.004_68] perldoc.PL
--
Date: Fri, 26 Jun 98 17:50:05 BST
Message-Id: <6834.9806261650@tempest.cise.npl.co.uk>
From: Robin Barker <rmb1@cise.npl.co.uk>
Subject: [PATCH 5.004_68] perldoc.PL

p4raw-id: //depot/perl@1225

utils/perldoc.PL

index b7b16e8..3805f6a 100644 (file)
@@ -306,13 +306,13 @@ foreach (@pages) {
                for ($i = 0; $trn = $ENV{'DCL$PATH'.$i}; $i++) {
                    push(@searchdirs,$trn);
                }
-           push(@dirs,'perl_root:[lib.pod]')  # installed pods
+               push(@searchdirs,'perl_root:[lib.pod]')  # installed pods
            } else {
                push(@searchdirs, grep(-d, split($Config{path_sep}, 
                                                 $ENV{'PATH'})));
            }
-           @files= searchfor(0,$_,@searchdirs);
        }
+       @files = searchfor(0,$_,@searchdirs);
        if( @files ) {
                print STDERR "Found as @files\n" if $opt_v;
        } else {
@@ -352,6 +352,8 @@ if ($opt_l) {
     exit;
 }
 
+my $lines = $ENV{LINES} || 24;
+
 if( ! -t STDOUT ) { $no_tty = 1 }
 
 if ($Is_MSWin32) {
@@ -410,8 +412,6 @@ if ($opt_f) {
        ++$found if /^\w/;      # found descriptive text
    }
    if (@pod) {
-       my $lines = $ENV{LINES} || 24;
-
        if ($opt_t) {
           open(FORMATTER, "| pod2text") || die "Can't start filter";
           print FORMATTER "=over 8\n\n";
@@ -458,11 +458,18 @@ if ($opt_q) {
         print FORMATTER @pod;
         print FORMATTER "=back\n";
         close(FORMATTER);
-      } else {
+      } elsif (@pod < $lines-2) {
         print @pod;
+      } else {
+        foreach $pager (@pagers) {
+           open (PAGER, "| $pager") or next;
+           print PAGER @pod ;
+           close(PAGER) or next;
+           last;
+        }
       }
    } else {
-      die "No documentation for perl function `$opt_f' found\n";
+      die "No documentation for perl FAQ keyword `$opt_q' found\n";
    }
    exit;
 }