X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fsplain.PL;h=9c70b61afd545e70f6c6616ee9d97e0896b316c0;hb=2bd49cfcbebe5157c802aba335cb6f76b1afa6fd;hp=53954db65a8050c5fb24d2612faa321d8c57d229;hpb=5f05dabc4054964aa3b10f44f8468547f051cdf8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/splain.PL b/utils/splain.PL index 53954db..9c70b61 100644 --- a/utils/splain.PL +++ b/utils/splain.PL @@ -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,13 +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. -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'; +$IN = File::Spec->catfile(File::Spec->updir, 'lib', 'diagnostics.pm'); open IN or die "Can't open $IN: $!\n"; # Create output file. @@ -45,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;