X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/5f05dabc4054964aa3b10f44f8468547f051cdf8..bedb3eda9cc0dff5f60e1d7c83c2a82287a6b580:/utils/splain.PL diff --git a/utils/splain.PL b/utils/splain.PL index 53954db..a638dba 100644 --- a/utils/splain.PL +++ b/utils/splain.PL @@ -2,6 +2,7 @@ use Config; use File::Basename qw(&basename &dirname); +use Cwd; # List explicitly here the variables you want Configure to # generate. Metaconfig only looks for shell variables, so you @@ -13,10 +14,10 @@ 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. -chdir(dirname($0)); -($file = basename($0)) =~ s/\.PL$//; -$file =~ s/\.pl$// - if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving" +$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'; @@ -45,3 +46,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;