X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fperldoc.PL;h=ca631dda2b6e18b569f35e16c2e152d92a93374a;hb=16ba52cf04376a6afd806dc9ac35d10e783fbbd1;hp=5d136b305cae8544128913609fb64920f94e14a5;hpb=ee8c7f5465f003860e2347a2946abacac39bd9b9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 5d136b3..ca631dd 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -38,7 +38,7 @@ INIT { eval { umask(0077) } } # doubtless someone has no mask my \@pagers = (); push \@pagers, "$Config{'pager'}" if -x "$Config{'pager'}"; -my \$bindir = "$Config{installscript}"; +my \$bindir = '$Config{scriptdir}'; !GROK!THIS! @@ -203,7 +203,7 @@ if (-f "Makefile.PL") { eval q{ use lib qw(. lib); 1; } or die; # don't add if superuser - if ($< && $>) { # don't be looking too hard now! + if ($< && $> && -f "blib") { # don't be looking too hard now! eval q{ use blib; 1 }; warn $@ if $@ && $opt_v; } @@ -409,7 +409,11 @@ sub page { } else { foreach my $pager (@pagers) { - last if system("$pager $tmp") == 0; + if ($Is_VMS) { + last if system("$pager $tmp") == 0; # quoting prevents logical expansion + } else { + last if system("$pager \"$tmp\"") == 0; + } } } } @@ -439,9 +443,9 @@ foreach (@pages) { next; } print STDERR "Searching for $_\n" if $opt_v; - # We must look both in @INC for library modules and in PATH + # We must look both in @INC for library modules and in $bindir # for executables, like h2xs or perldoc itself. - my @searchdirs = @INC; + my @searchdirs = ($bindir, @INC); if ($opt_F) { next unless -r; push @found, $_ if $opt_m or containspod($_); @@ -555,7 +559,10 @@ eval q{ sub END { cleanup($tmp, $buffer) } 1; } || die; -eval q{ use sigtrap qw(die INT TERM HUP QUIT) }; + +# exit/die in a windows sighandler is dangerous, so let it do the +# default thing, which is to exit +eval q{ use sigtrap qw(die INT TERM HUP QUIT) } unless $^O eq 'MSWin32'; if ($opt_m) { foreach my $pager (@pagers) {