This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove GV_ADDINEVAL
[perl5.git] / utils / splain.PL
index ef7c457..9c70b61 100644 (file)
@@ -2,6 +2,8 @@
 
 use Config;
 use File::Basename qw(&basename &dirname);
+use File::Spec;
+use Cwd;
 
 # List explicitly here the variables you want Configure to
 # generate.  Metaconfig only looks for shell variables, so you
@@ -13,11 +15,13 @@ use File::Basename qw(&basename &dirname);
 
 # This forces PL files to create target in same directory as PL file.
 # This is so that make depend always knows where to find PL derivatives.
+$origdir = cwd;
 chdir dirname($0);
 $file = basename($0, '.PL');
+$file .= '.com' if $^O eq 'VMS';
 
 # Open input file before creating output file.
-$IN = '../lib/diagnostics.pm';
+$IN = File::Spec->catfile(File::Spec->updir, 'lib', 'diagnostics.pm');
 open IN or die "Can't open $IN: $!\n";
 
 # Create output file.
@@ -43,3 +47,4 @@ close IN;
 close OUT or die "Can't close $file: $!";
 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
+chdir $origdir;