summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-03-22 15:57:24 +1200
committerChip Salzenberg <chip@atlantic.net>1997-03-26 07:04:34 +1200
commit91a06757ac3b925b7c0c6afbf3f1378bd4051754 (patch)
tree0f4e19e9a2081019a69db3a99c4c784a7171721c /lib
parenta3c8358ce414426ff5d7d0ca29f8d98f18d4c878 (diff)
downloadperl-91a06757ac3b925b7c0c6afbf3f1378bd4051754.tar.gz
Allow for coexistence of various versions of perldiag.pod
Diffstat (limited to 'lib')
-rw-r--r--lib/diagnostics.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm
index 5e8e971f44..0bdf1be1fa 100644
--- a/lib/diagnostics.pm
+++ b/lib/diagnostics.pm
@@ -166,12 +166,16 @@ require 5.001;
use Carp;
use Config;
+($privlib, $archlib) = @Config{qw(privlibexp archlibexp)};
if ($^O eq 'VMS') {
- $PODFILE = VMS::Filespec::unixify($Config{privlibexp}).'/pod/perldiag.pod';
-}
-else {
- $PODFILE = $Config{privlibexp} . "/pod/perldiag.pod";
+ require VMS::Filespec;
+ $privlib = VMS::Filespec::unixify($privlib);
+ $archlib = VMS::Filespec::unixify($archlib);
}
+@trypod = ("$archlib/pod/perldiag.pod",
+ "$privlib/pod/perldiag-$].pod",
+ "$privlib/pod/perldiag.pod");
+($PODFILE) = ((grep { -e } @trypod), $trypod[$#trypod])[0];
$DEBUG ||= 0;
my $WHOAMI = ref bless []; # nobody's business, prolly not even mine
@@ -188,7 +192,8 @@ CONFIG: {
unless (caller) {
$standalone++;
require Getopt::Std;
- Getopt::Std::getopts('pdvf:') || die "Usage: $0 [-v] [-p] [-f splainpod]";
+ Getopt::Std::getopts('pdvf:')
+ or die "Usage: $0 [-v] [-p] [-f splainpod]";
$PODFILE = $opt_f if $opt_f;
$DEBUG = 2 if $opt_d;
$VERBOSE = $opt_v;