h2ph
[p5sagit/p5-mst-13.2.git] / utils / perldoc.PL
CommitLineData
4633a7c4 1#!/usr/local/bin/perl
2
3use Config;
4use File::Basename qw(&basename &dirname);
8a5546a1 5use Cwd;
4633a7c4 6
85880f03 7# List explicitly here the variables you want Configure to
8# generate. Metaconfig only looks for shell variables, so you
9# have to mention them as if they were shell variables, not
10# %Config entries. Thus you write
4633a7c4 11# $startperl
85880f03 12# to ensure Configure will look for $Config{startperl}.
4633a7c4 13
14# This forces PL files to create target in same directory as PL file.
15# This is so that make depend always knows where to find PL derivatives.
8a5546a1 16$origdir = cwd;
44a8e56a 17chdir dirname($0);
18$file = basename($0, '.PL');
774d564b 19$file .= '.com' if $^O eq 'VMS';
4633a7c4 20
21open OUT,">$file" or die "Can't create $file: $!";
22
23print "Extracting $file (with variable substitutions)\n";
24
25# In this section, perl variables will be expanded during extraction.
26# You can use $Config{...} to use Configure variables.
27
85880f03 28print OUT <<"!GROK!THIS!";
5f05dabc 29$Config{startperl}
30 eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
c5ae3962 31 if 0;
55497cff 32
c5ae3962 33use strict;
34my \@pagers = ();
55497cff 35push \@pagers, "$Config{'pager'}" if -x "$Config{'pager'}";
4633a7c4 36!GROK!THIS!
37
38# In the following, perl variables are not expanded during extraction.
39
40print OUT <<'!NO!SUBS!';
41
42#
43# Perldoc revision #1 -- look up a piece of documentation in .pod format that
44# is embedded in the perl installation tree.
45#
46# This is not to be confused with Tom Christianson's perlman, which is a
47# man replacement, written in perl. This perldoc is strictly for reading
48# the perl manuals, though it too is written in perl.
4633a7c4 49
50if(@ARGV<1) {
c5ae3962 51 my $me = $0; # Editing $0 is unportable
fb73857a 52 $me =~ s,.*/,,;
4633a7c4 53 die <<EOF;
5315ba28 54Usage: $me [-h] [-r] [-i] [-v] [-t] [-u] [-m] [-l] [-F] [-X] PageName|ModuleName|ProgramName
0b166b66 55 $me -f PerlFunc
a3cb178b 56 $me -q FAQKeywords
4633a7c4 57
89b8affa 58The -h option prints more help. Also try "perldoc perldoc" to get
59aquainted with the system.
4633a7c4 60EOF
61}
62
63use Getopt::Std;
59586d77 64use Config '%Config';
65
c5ae3962 66my @global_found = ();
67my $global_target = "";
fb73857a 68
c5ae3962 69my $Is_VMS = $^O eq 'VMS';
70my $Is_MSWin32 = $^O eq 'MSWin32';
71my $Is_Dos = $^O eq 'dos';
4633a7c4 72
73sub usage{
ff0cee69 74 warn "@_\n" if @_;
75 # Erase evidence of previous errors (if any), so exit status is simple.
76 $! = 0;
4633a7c4 77 die <<EOF;
31bdbec1 78perldoc [options] PageName|ModuleName|ProgramName...
79perldoc [options] -f BuiltinFunction
a3cb178b 80perldoc [options] -q FAQRegex
31bdbec1 81
82Options:
137443ea 83 -h Display this help message
5315ba28 84 -r Recursive search (slow)
85 -i Ignore case
137443ea 86 -t Display pod using pod2text instead of pod2man and nroff
87 (-t is the default on win32)
85880f03 88 -u Display unformatted pod text
a3cb178b 89 -m Display module's file in its entirety
90 -l Display the module's file name
cce34969 91 -F Arguments are file names, not modules
137443ea 92 -v Verbosely describe what's going on
89b8affa 93 -X use index if present (looks for pod.idx at $Config{archlib})
54ac30b1 94 -q Search the text of questions (not answers) in perlfaq[1-9]
a3cb178b 95
4633a7c4 96PageName|ModuleName...
97 is the name of a piece of documentation that you want to look at. You
98 may either give a descriptive name of the page (as in the case of
99 `perlfunc') the name of a module, either like `Term::Info',
100 `Term/Info', the partial name of a module, like `info', or
101 `makemaker', or the name of a program, like `perldoc'.
31bdbec1 102
103BuiltinFunction
104 is the name of a perl function. Will extract documentation from
105 `perlfunc'.
a3cb178b 106
107FAQRegex
108 is a regex. Will search perlfaq[1-9] for and extract any
109 questions that match.
110
4633a7c4 111Any switches in the PERLDOC environment variable will be used before the
89b8affa 112command line arguments. The optional pod index file contains a list of
113filenames, one per line.
4633a7c4 114
115EOF
116}
117
c5ae3962 118if( defined $ENV{"PERLDOC"} ) {
119 require Text::ParseWords;
120 unshift(@ARGV, Text::ParseWords::shellwords($ENV{"PERLDOC"}));
121}
122!NO!SUBS!
123
124my $getopts = "mhtluvriFf:Xq:";
125print OUT <<"!GET!OPTS!";
4633a7c4 126
c5ae3962 127use vars qw( @{[map "\$opt_$_", ($getopts =~ /\w/g)]} );
4633a7c4 128
c5ae3962 129getopts("$getopts") || usage;
130!GET!OPTS!
4633a7c4 131
c5ae3962 132print OUT <<'!NO!SUBS!';
85880f03 133
c5ae3962 134usage if $opt_h;
4633a7c4 135
c5ae3962 136my $podidx;
0d3da1c8 137if( $opt_X ) {
138 $podidx = "$Config{'archlib'}/pod.idx";
139 $podidx = "" unless -f $podidx && -r _ && -M _ <= 7;
140}
89b8affa 141
c5ae3962 142if( (my $opts = do{ local $^W; $opt_t + $opt_u + $opt_m + $opt_l }) > 1) {
137443ea 143 usage("only one of -t, -u, -m or -l")
0151c6ef 144} elsif ($Is_MSWin32 || $Is_Dos) {
c5ae3962 145 $opt_t = 1 unless $opts
137443ea 146}
4633a7c4 147
7eda7aea 148if ($opt_t) { require Pod::Text; import Pod::Text; }
4633a7c4 149
c5ae3962 150my @pages;
31bdbec1 151if ($opt_f) {
152 @pages = ("perlfunc");
a3cb178b 153} elsif ($opt_q) {
154 @pages = ("perlfaq1" .. "perlfaq9");
31bdbec1 155} else {
156 @pages = @ARGV;
157}
158
fb73857a 159# Does this look like a module or extension directory?
160if (-f "Makefile.PL") {
161 # Add ., lib and blib/* libs to @INC (if they exist)
162 unshift(@INC, '.');
163 unshift(@INC, 'lib') if -d 'lib';
164 require ExtUtils::testlib;
165}
166
31bdbec1 167
85880f03 168
4633a7c4 169sub containspod {
fb73857a 170 my($file, $readit) = @_;
171 return 1 if !$readit && $file =~ /\.pod$/i;
172 local($_);
173 open(TEST,"<$file");
174 while(<TEST>) {
175 if(/^=head/) {
176 close(TEST);
177 return 1;
4633a7c4 178 }
fb73857a 179 }
180 close(TEST);
181 return 0;
4633a7c4 182}
183
84902520 184sub minus_f_nocase {
5315ba28 185 my($dir,$file) = @_;
186 my $path = join('/',$dir,$file);
187 return $path if -f $path and -r _;
188 if (!$opt_i or $Is_VMS or $Is_MSWin32 or $Is_Dos or $^O eq 'os2') {
189 # on a case-forgiving file system or if case is important
190 # that is it all we can do
0cf744f2 191 warn "Ignored $path: unreadable\n" if -f _;
fb73857a 192 return '';
84902520 193 }
4633a7c4 194 local *DIR;
195 local($")="/";
5315ba28 196 my @p = ($dir);
197 my($p,$cip);
4633a7c4 198 foreach $p (split(/\//, $file)){
fb73857a 199 my $try = "@p/$p";
200 stat $try;
201 if (-d _){
4633a7c4 202 push @p, $p;
fb73857a 203 if ( $p eq $global_target) {
c5ae3962 204 my $tmp_path = join ('/', @p);
fb73857a 205 my $path_f = 0;
206 for (@global_found) {
207 $path_f = 1 if $_ eq $tmp_path;
208 }
209 push (@global_found, $tmp_path) unless $path_f;
210 print STDERR "Found as @p but directory\n" if $opt_v;
211 }
212 } elsif (-f _ && -r _) {
213 return $try;
214 } elsif (-f _) {
215 warn "Ignored $try: unreadable\n";
4633a7c4 216 } else {
217 my $found=0;
218 my $lcp = lc $p;
219 opendir DIR, "@p";
220 while ($cip=readdir(DIR)) {
221 if (lc $cip eq $lcp){
222 $found++;
223 last;
224 }
225 }
226 closedir DIR;
227 return "" unless $found;
228 push @p, $cip;
fb73857a 229 return "@p" if -f "@p" and -r _;
0cf744f2 230 warn "Ignored @p: unreadable\n" if -f _;
4633a7c4 231 }
232 }
5315ba28 233 return "";
fb73857a 234}
eb459f90 235
fb73857a 236
237sub check_file {
5315ba28 238 my($dir,$file) = @_;
3046dd9f 239 if ($opt_m) {
5315ba28 240 return minus_f_nocase($dir,$file);
3046dd9f 241 } else {
5315ba28 242 my $path = minus_f_nocase($dir,$file);
249edfdf 243 return $path if length $path and containspod($path);
3046dd9f 244 }
5315ba28 245 return "";
fb73857a 246}
247
248
249sub searchfor {
250 my($recurse,$s,@dirs) = @_;
251 $s =~ s!::!/!g;
252 $s = VMS::Filespec::unixify($s) if $Is_VMS;
253 return $s if -f $s && containspod($s);
254 printf STDERR "Looking for $s in @dirs\n" if $opt_v;
255 my $ret;
256 my $i;
257 my $dir;
258 $global_target = (split('/', $s))[-1];
259 for ($i=0; $i<@dirs; $i++) {
260 $dir = $dirs[$i];
261 ($dir = VMS::Filespec::unixpath($dir)) =~ s!/$!! if $Is_VMS;
5315ba28 262 if ( ( $ret = check_file $dir,"$s.pod")
263 or ( $ret = check_file $dir,"$s.pm")
264 or ( $ret = check_file $dir,$s)
fb73857a 265 or ( $Is_VMS and
5315ba28 266 $ret = check_file $dir,"$s.com")
59586d77 267 or ( $^O eq 'os2' and
5315ba28 268 $ret = check_file $dir,"$s.cmd")
0151c6ef 269 or ( ($Is_MSWin32 or $Is_Dos or $^O eq 'os2') and
5315ba28 270 $ret = check_file $dir,"$s.bat")
271 or ( $ret = check_file "$dir/pod","$s.pod")
272 or ( $ret = check_file "$dir/pod",$s)
fb73857a 273 ) {
274 return $ret;
275 }
eb459f90 276
fb73857a 277 if ($recurse) {
278 opendir(D,$dir);
279 my @newdirs = map "$dir/$_", grep {
280 not /^\.\.?$/ and
281 not /^auto$/ and # save time! don't search auto dirs
282 -d "$dir/$_"
283 } readdir D;
284 closedir(D);
285 next unless @newdirs;
286 @newdirs = map((s/.dir$//,$_)[1],@newdirs) if $Is_VMS;
287 print STDERR "Also looking in @newdirs\n" if $opt_v;
288 push(@dirs,@newdirs);
289 }
290 }
291 return ();
292}
4633a7c4 293
eb459f90 294sub filter_nroff {
295 my @data = split /\n{2,}/, shift;
296 shift @data while @data and $data[0] !~ /\S/; # Go to header
297 shift @data if @data and $data[0] =~ /Contributed\s+Perl/; # Skip header
298 pop @data if @data and $data[-1] =~ /^\w/; # Skip footer, like
299 # 28/Jan/99 perl 5.005, patch 53 1
300 join "\n\n", @data;
301}
302
c5ae3962 303my @found;
4633a7c4 304foreach (@pages) {
89b8affa 305 if ($podidx && open(PODIDX, $podidx)) {
306 my $searchfor = $_;
307 local($_);
308 $searchfor =~ s,::,/,g;
309 print STDERR "Searching for '$searchfor' in $podidx\n" if $opt_v;
310 while (<PODIDX>) {
311 chomp;
312 push(@found, $_) if m,/$searchfor(?:\.(?:pod|pm))?$,i;
313 }
314 close(PODIDX);
315 next;
316 }
4633a7c4 317 print STDERR "Searching for $_\n" if $opt_v;
318 # We must look both in @INC for library modules and in PATH
319 # for executables, like h2xs or perldoc itself.
c5ae3962 320 my @searchdirs = @INC;
cce34969 321 if ($opt_F) {
322 next unless -r;
323 push @found, $_ if $opt_m or containspod($_);
324 next;
325 }
7eda7aea 326 unless ($opt_m) {
327 if ($Is_VMS) {
328 my($i,$trn);
562a7b0c 329 for ($i = 0; $trn = $ENV{'DCL$PATH;'.$i}; $i++) {
7eda7aea 330 push(@searchdirs,$trn);
331 }
877622ba 332 push(@searchdirs,'perl_root:[lib.pod]') # installed pods
7eda7aea 333 } else {
59586d77 334 push(@searchdirs, grep(-d, split($Config{path_sep},
335 $ENV{'PATH'})));
7eda7aea 336 }
85880f03 337 }
c5ae3962 338 my @files = searchfor(0,$_,@searchdirs);
4633a7c4 339 if( @files ) {
340 print STDERR "Found as @files\n" if $opt_v;
341 } else {
342 # no match, try recursive search
eb459f90 343
4633a7c4 344 @searchdirs = grep(!/^\.$/,@INC);
eb459f90 345
5315ba28 346 @files= searchfor(1,$_,@searchdirs) if $opt_r;
4633a7c4 347 if( @files ) {
85880f03 348 print STDERR "Loosely found as @files\n" if $opt_v;
4633a7c4 349 } else {
fb73857a 350 print STDERR "No documentation found for \"$_\".\n";
351 if (@global_found) {
352 print STDERR "However, try\n";
c5ae3962 353 for my $dir (@global_found) {
fb73857a 354 opendir(DIR, $dir) or die "$!";
c5ae3962 355 while (my $file = readdir(DIR)) {
fb73857a 356 next if ($file =~ /^\./);
357 $file =~ s/\.(pm|pod)$//;
358 print STDERR "\tperldoc $_\::$file\n";
359 }
360 closedir DIR;
361 }
362 }
4633a7c4 363 }
364 }
365 push(@found,@files);
366}
367
368if(!@found) {
85880f03 369 exit ($Is_VMS ? 98962 : 1);
4633a7c4 370}
371
44a8e56a 372if ($opt_l) {
373 print join("\n", @found), "\n";
374 exit;
375}
376
877622ba 377my $lines = $ENV{LINES} || 24;
378
c5ae3962 379my $no_tty;
31bdbec1 380if( ! -t STDOUT ) { $no_tty = 1 }
4633a7c4 381
c5ae3962 382my $tmp;
137443ea 383if ($Is_MSWin32) {
384 $tmp = "$ENV{TEMP}\\perldoc1.$$";
385 push @pagers, qw( more< less notepad );
55497cff 386 unshift @pagers, $ENV{PAGER} if $ENV{PAGER};
137443ea 387} elsif ($Is_VMS) {
4633a7c4 388 $tmp = 'Sys$Scratch:perldoc.tmp1_'.$$;
55497cff 389 push @pagers, qw( most more less type/page );
0151c6ef 390} elsif ($Is_Dos) {
391 $tmp = "$ENV{TEMP}/perldoc1.$$";
392 $tmp =~ tr!\\/!//!s;
393 push @pagers, qw( less.exe more.com< );
394 unshift @pagers, $ENV{PAGER} if $ENV{PAGER};
137443ea 395} else {
59586d77 396 if ($^O eq 'os2') {
397 require POSIX;
398 $tmp = POSIX::tmpnam();
491527d0 399 unshift @pagers, 'less', 'cmd /c more <';
59586d77 400 } else {
eb459f90 401 $tmp = "/tmp/perldoc1.$$";
59586d77 402 }
137443ea 403 push @pagers, qw( more less pg view cat );
404 unshift @pagers, $ENV{PAGER} if $ENV{PAGER};
4633a7c4 405}
44a8e56a 406unshift @pagers, $ENV{PERLDOC_PAGER} if $ENV{PERLDOC_PAGER};
4633a7c4 407
7eda7aea 408if ($opt_m) {
c5ae3962 409 foreach my $pager (@pagers) {
1e422769 410 system("$pager @found") or exit;
411 }
412 if ($Is_VMS) { eval 'use vmsish qw(status exit); exit $?' }
413 exit 1;
eb459f90 414}
7eda7aea 415
eb459f90 416my @pod;
31bdbec1 417if ($opt_f) {
418 my $perlfunc = shift @found;
419 open(PFUNC, $perlfunc) or die "Can't open $perlfunc: $!";
420
c437c457 421 # Functions like -r, -e, etc. are listed under `-X'.
422 my $search_string = ($opt_f =~ /^-[rwxoRWXOeszfdlpSbctugkTBMAC]$/) ? 'I<-X' : $opt_f ;
423
31bdbec1 424 # Skip introduction
425 while (<PFUNC>) {
426 last if /^=head2 Alphabetical Listing of Perl Functions/;
427 }
428
429 # Look for our function
430 my $found = 0;
431 while (<PFUNC>) {
c437c457 432 if (/^=item\s+\Q$search_string\E\b/o) {
fb73857a 433 $found = 1;
31bdbec1 434 } elsif (/^=item/) {
fb73857a 435 last if $found > 1;
31bdbec1 436 }
fb73857a 437 next unless $found;
438 push @pod, $_;
439 ++$found if /^\w/; # found descriptive text
31bdbec1 440 }
eb459f90 441 if (!@pod) {
ed5c9e50 442 die "No documentation for perl function `$opt_f' found\n";
31bdbec1 443 }
31bdbec1 444}
445
a3cb178b 446if ($opt_q) {
447 local @ARGV = @found; # I'm lazy, sue me.
448 my $found = 0;
449 my %found_in;
a3cb178b 450
451 while (<>) {
54ac30b1 452 if (/^=head2\s+.*(?:$opt_q)/oi) {
a3cb178b 453 $found = 1;
454 push @pod, "=head1 Found in $ARGV\n\n" unless $found_in{$ARGV}++;
455 } elsif (/^=head2/) {
456 $found = 0;
457 }
458 next unless $found;
459 push @pod, $_;
460 }
eb459f90 461
462 if (!@pod) {
877622ba 463 die "No documentation for perl FAQ keyword `$opt_q' found\n";
a3cb178b 464 }
eb459f90 465}
466
467my $tmp1;
468my $filter;
469
470if (@pod) {
471 $tmp1 = $tmp . "_";
472 open(TMP,">$tmp1") or die "open '$tmp1': $!";
473 print TMP "=over 8\n\n";
474 print TMP @pod;
475 print TMP "=back\n";
476 close(TMP) or die "close '$tmp1': $!";
477 @found = $tmp1;
478 $filter = 1;
a3cb178b 479}
480
4633a7c4 481foreach (@found) {
7eda7aea 482
c5ae3962 483 my $err;
85880f03 484 if($opt_t) {
485 open(TMP,">>$tmp");
486 Pod::Text::pod2text($_,*TMP);
487 close(TMP);
488 } elsif(not $opt_u) {
1e422769 489 my $cmd = "pod2man --lax $_ | nroff -man";
490 $cmd .= " | col -x" if $^O =~ /hpux/;
c5ae3962 491 my $rslt = `$cmd`;
eb459f90 492 $rslt = filter_nroff $rslt if $filter;
1e422769 493 unless(($err = $?)) {
494 open(TMP,">>$tmp");
495 print TMP $rslt;
496 close TMP;
40fc7247 497 }
85880f03 498 }
eb459f90 499
85880f03 500 if( $opt_u or $err or -z $tmp) {
4633a7c4 501 open(OUT,">>$tmp");
502 open(IN,"<$_");
c5ae3962 503 my $cut = 1;
85880f03 504 while (<IN>) {
505 $cut = $1 eq 'cut' if /^=(\w+)/;
506 next if $cut;
507 print OUT;
508 }
4633a7c4 509 close(IN);
510 close(OUT);
511 }
512}
513
31bdbec1 514if( $no_tty ) {
4633a7c4 515 open(TMP,"<$tmp");
516 print while <TMP>;
517 close(TMP);
518} else {
c5ae3962 519 foreach my $pager (@pagers) {
1e422769 520 system("$pager $tmp") or last;
4633a7c4 521 }
522}
523
5241 while unlink($tmp); #Possibly pointless VMSism
eb459f90 525if (defined $tmp1) {
526 1 while unlink($tmp1); #Possibly pointless VMSism
527}
4633a7c4 528
529exit 0;
7eda7aea 530
531__END__
532
533=head1 NAME
534
535perldoc - Look up Perl documentation in pod format.
536
537=head1 SYNOPSIS
538
89b8affa 539B<perldoc> [B<-h>] [B<-v>] [B<-t>] [B<-u>] [B<-m>] [B<-l>] [B<-F>] [B<-X>] PageName|ModuleName|ProgramName
7eda7aea 540
31bdbec1 541B<perldoc> B<-f> BuiltinFunction
542
c8950503 543B<perldoc> B<-q> FAQ Keyword
544
7eda7aea 545=head1 DESCRIPTION
546
40fc7247 547I<perldoc> looks up a piece of documentation in .pod format that is embedded
548in the perl installation tree or in a perl script, and displays it via
549C<pod2man | nroff -man | $PAGER>. (In addition, if running under HP-UX,
550C<col -x> will be used.) This is primarily used for the documentation for
551the perl library modules.
7eda7aea 552
553Your system may also have man pages installed for those modules, in
554which case you can probably just use the man(1) command.
555
556=head1 OPTIONS
557
558=over 5
559
560=item B<-h> help
561
562Prints out a brief help message.
563
564=item B<-v> verbose
565
566Describes search for the item in detail.
567
568=item B<-t> text output
569
570Display docs using plain text converter, instead of nroff. This may be faster,
571but it won't look as nice.
572
573=item B<-u> unformatted
574
575Find docs only; skip reformatting by pod2*
576
577=item B<-m> module
578
579Display the entire module: both code and unformatted pod documentation.
580This may be useful if the docs don't explain a function in the detail
581you need, and you'd like to inspect the code directly; perldoc will find
582the file for you and simply hand it off for display.
583
44a8e56a 584=item B<-l> file name only
585
586Display the file name of the module found.
587
cce34969 588=item B<-F> file names
589
89b8affa 590Consider arguments as file names, no search in directories will be performed.
cce34969 591
31bdbec1 592=item B<-f> perlfunc
593
594The B<-f> option followed by the name of a perl built in function will
595extract the documentation of this function from L<perlfunc>.
596
c8950503 597=item B<-q> perlfaq
598
599The B<-q> option takes a regular expression as an argument. It will search
600the question headings in perlfaq[1-9] and print the entries matching
601the regular expression.
602
89b8affa 603=item B<-X> use an index if present
604
605The B<-X> option looks for a entry whose basename matches the name given on the
606command line in the file C<$Config{archlib}/pod.idx>. The pod.idx file should
607contain fully qualified filenames, one per line.
608
7eda7aea 609=item B<PageName|ModuleName|ProgramName>
610
611The item you want to look up. Nested modules (such as C<File::Basename>)
612are specified either as C<File::Basename> or C<File/Basename>. You may also
613give a descriptive name of a page, such as C<perlfunc>. You make also give a
614partial or wrong-case name, such as "basename" for "File::Basename", but
615this will be slower, if there is more then one page with the same partial
616name, you will only get the first one.
617
618=back
619
620=head1 ENVIRONMENT
621
622Any switches in the C<PERLDOC> environment variable will be used before the
623command line arguments. C<perldoc> also searches directories
624specified by the C<PERL5LIB> (or C<PERLLIB> if C<PERL5LIB> is not
625defined) and C<PATH> environment variables.
626(The latter is so that embedded pods for executables, such as
a3cb178b 627C<perldoc> itself, are available.) C<perldoc> will use, in order of
628preference, the pager defined in C<PERLDOC_PAGER>, C<MANPAGER>, or
629C<PAGER> before trying to find a pager on its own. (C<MANPAGER> is not
630used if C<perldoc> was told to display plain text or unformatted pod.)
7eda7aea 631
eb459f90 632One useful value for C<PERLDOC_PAGER> is C<less -+C -E>.
633
7eda7aea 634=head1 AUTHOR
635
636Kenneth Albanowski <kjahds@kjahds.com>
637
638Minor updates by Andy Dougherty <doughera@lafcol.lafayette.edu>
639
7eda7aea 640=cut
641
642#
c5ae3962 643# Version 1.14: Wed Jul 15 01:50:20 EST 1998
644# Robin Barker <rmb1@cise.npl.co.uk>
645# -strict, -w cleanups
89b8affa 646# Version 1.13: Fri Feb 27 16:20:50 EST 1997
647# Gurusamy Sarathy <gsar@umich.edu>
648# -doc tweaks for -F and -X options
137443ea 649# Version 1.12: Sat Apr 12 22:41:09 EST 1997
650# Gurusamy Sarathy <gsar@umich.edu>
651# -various fixes for win32
7eda7aea 652# Version 1.11: Tue Dec 26 09:54:33 EST 1995
653# Kenneth Albanowski <kjahds@kjahds.com>
654# -added Charles Bailey's further VMS patches, and -u switch
655# -added -t switch, with pod2text support
656#
657# Version 1.10: Thu Nov 9 07:23:47 EST 1995
658# Kenneth Albanowski <kjahds@kjahds.com>
659# -added VMS support
660# -added better error recognition (on no found pages, just exit. On
661# missing nroff/pod2man, just display raw pod.)
662# -added recursive/case-insensitive matching (thanks, Andreas). This
663# slows things down a bit, unfortunately. Give a precise name, and
664# it'll run faster.
665#
666# Version 1.01: Tue May 30 14:47:34 EDT 1995
667# Andy Dougherty <doughera@lafcol.lafayette.edu>
668# -added pod documentation.
669# -added PATH searching.
670# -added searching pod/ subdirectory (mainly to pick up perlfunc.pod
671# and friends.
672#
673#
674# TODO:
675#
676# Cache directories read during sloppy match
4633a7c4 677!NO!SUBS!
678
679close OUT or die "Can't close $file: $!";
680chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
681exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
8a5546a1 682chdir $origdir;