summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.ohio-state.edu>1997-06-16 12:18:02 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-08-07 00:00:00 +1200
commit59586d7795db81c5ffcd935ba8614353199c2a71 (patch)
treedc99df43a7a299c185c2345c8e188a942988e167
parentf72119fc50f0d88b02501ba41112f82ab99f0c3b (diff)
downloadperl-59586d7795db81c5ffcd935ba8614353199c2a71.tar.gz
perldoc under OS/2
We split path on $Config{path_sep} instead of '/' (Yes!), check for .cmd and .bat files if needed, and use POSIX::tmpnam to get a tmp file (last only on OS/2 for extra safety). Enjoy, p5p-msgid: 199707180340.XAA03114@monk.mps.ohio-state.edu
-rw-r--r--utils/perldoc.PL18
1 files changed, 13 insertions, 5 deletions
diff --git a/utils/perldoc.PL b/utils/perldoc.PL
index 999496b8e2..a17cca9b50 100644
--- a/utils/perldoc.PL
+++ b/utils/perldoc.PL
@@ -56,6 +56,8 @@ EOF
}
use Getopt::Std;
+use Config '%Config';
+
$Is_VMS = $^O eq 'VMS';
$Is_MSWin32 = $^O eq 'MSWin32';
@@ -188,7 +190,9 @@ sub containspod {
or ( $ret = minus_f_nocase "$dir/$s" and containspod($ret))
or ( $Is_VMS and
$ret = minus_f_nocase "$dir/$s.com" and containspod($ret))
- or ( $Is_MSWin32 and
+ or ( $^O eq 'os2' and
+ $ret = minus_f_nocase "$dir/$s.cmd" and containspod($ret))
+ or ( ($Is_MSWin32 or $^O eq 'os2') and
$ret = minus_f_nocase "$dir/$s.bat" and containspod($ret))
or ( $ret = minus_f_nocase "$dir/pod/$s.pod")
or ( $ret = minus_f_nocase "$dir/pod/$s" and containspod($ret)))
@@ -219,10 +223,9 @@ foreach (@pages) {
for ($i = 0; $trn = $ENV{'DCL$PATH'.$i}; $i++) {
push(@searchdirs,$trn);
}
- } elsif ($Is_MSWin32) {
- push(@searchdirs, grep(-d, split(';', $ENV{'PATH'})));
} else {
- push(@searchdirs, grep(-d, split(':', $ENV{'PATH'})));
+ push(@searchdirs, grep(-d, split($Config{path_sep},
+ $ENV{'PATH'})));
}
@files= searchfor(0,$_,@searchdirs);
}
@@ -263,7 +266,12 @@ if ($Is_MSWin32) {
$tmp = 'Sys$Scratch:perldoc.tmp1_'.$$;
push @pagers, qw( most more less type/page );
} else {
- $tmp = "/tmp/perldoc1.$$";
+ if ($^O eq 'os2') {
+ require POSIX;
+ $tmp = POSIX::tmpnam();
+ } else {
+ $tmp = "/tmp/perldoc1.$$";
+ }
push @pagers, qw( more less pg view cat );
unshift @pagers, $ENV{PAGER} if $ENV{PAGER};
}