From 43051805d53a3e4c5b2185a17655cab5bedc17ed Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Thu, 14 May 1998 06:24:38 +0000 Subject: [win32] merge changes#755..759,763,764 from maintbranch p4raw-link: @764 on //depot/maint-5.004/perl: b55845b185b3655fbcb60a4cd75d05dde49129cb p4raw-link: @763 on //depot/maint-5.004/perl: 150da09659bcba17cd7d84357c9e11bb0c85c6d8 p4raw-link: @759 on //depot/maint-5.004/perl: c8d70d09e95768371f69f084e8e237d2195ede65 p4raw-link: @755 on //depot/maint-5.004/perl: 284fa67c1ad7208c8b4dd82288a92c22d0bfdaca p4raw-id: //depot/win32/perl@934 --- utils/perldoc.PL | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'utils/perldoc.PL') diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 3a6059b4fd..752f335ca2 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -391,14 +391,23 @@ 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"; 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"; -- cgit v1.2.1 From a3cb178b0bad32fa8be934503d051b96a3cb1fea Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Thu, 14 May 1998 07:00:02 +0000 Subject: [win32] merge changes#872,873 from maintbranch p4raw-link: @873 on //depot/maint-5.004/perl: 990f469d529b62458be38e8659885fd26d353629 p4raw-link: @872 on //depot/maint-5.004/perl: 0b85608df162729d39cb0f96c9f88c7de0a3ceab p4raw-id: //depot/win32/perl@935 --- utils/perldoc.PL | 65 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 10 deletions(-) (limited to 'utils/perldoc.PL') diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 752f335ca2..bb3d69d8f5 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -50,6 +50,7 @@ if(@ARGV<1) { die <) { + if (/^=head2\s+.*$opt_q/oi) { + $found = 1; + push @pod, "=head1 Found in $ARGV\n\n" unless $found_in{$ARGV}++; + } elsif (/^=head2/) { + $found = 0; + } + next unless $found; + push @pod, $_; + } + + if (@pod) { + if ($opt_t) { + open(FORMATTER, "| pod2text") || die "Can't start filter"; + print FORMATTER "=over 8\n\n"; + print FORMATTER @pod; + print FORMATTER "=back\n"; + close(FORMATTER); + } else { + print @pod; + } + } else { + die "No documentation for perl function `$opt_f' found\n"; + } + exit; +} + foreach (@found) { if($opt_t) { @@ -548,7 +590,10 @@ command line arguments. C also searches directories specified by the C (or C if C is not defined) and C environment variables. (The latter is so that embedded pods for executables, such as -C itself, are available.) +C itself, are available.) C will use, in order of +preference, the pager defined in C, C, or +C before trying to find a pager on its own. (C is not +used if C was told to display plain text or unformatted pod.) =head1 AUTHOR -- cgit v1.2.1 From 491527d0220de34ec13035d557e288c9952d1007 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Thu, 14 May 1998 09:06:18 +0000 Subject: [win32] merge change#886 from maintbranch p4raw-link: @886 on //depot/maint-5.004/perl: 6dba07070c2cb08ffbc6e00eff60e8f5fc9a7ee8 p4raw-id: //depot/win32/perl@936 --- utils/perldoc.PL | 1 + 1 file changed, 1 insertion(+) (limited to 'utils/perldoc.PL') diff --git a/utils/perldoc.PL b/utils/perldoc.PL index bb3d69d8f5..326da7a563 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -361,6 +361,7 @@ if ($Is_MSWin32) { if ($^O eq 'os2') { require POSIX; $tmp = POSIX::tmpnam(); + unshift @pagers, 'less', 'cmd /c more <'; } else { $tmp = "/tmp/perldoc1.$$"; } -- cgit v1.2.1