From: Robin Barker Date: Tue, 23 Jun 1998 15:49:52 +0000 (+0100) Subject: hand apply whitespace mutiliated perldoc.PL patches X-Git-Tag: accepted/trunk/20130322.191538~37569 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=877622baf40bb04ea93c13070d881d4bff59d3df;p=platform%2Fupstream%2Fperl.git hand apply whitespace mutiliated perldoc.PL patches 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 Subject: [PATCH 5.004_68] perldoc.PL p4raw-id: //depot/perl@1225 --- diff --git a/utils/perldoc.PL b/utils/perldoc.PL index b7b16e8..3805f6a 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -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; }