X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fpl2pm.PL;h=48e281d1a57ed1b33bf9b22548a8ae2e968fa452;hb=0110aa014f97741d8a9f48382bd97bfc15d8cd60;hp=4e69036499598921fa0da84fafbb3206ebb645e5;hpb=f50fdf038490b1573b798e1f87716e6c0df0566e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/pl2pm.PL b/utils/pl2pm.PL old mode 100755 new mode 100644 index 4e69036..48e281d --- a/utils/pl2pm.PL +++ b/utils/pl2pm.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 @@ -12,11 +13,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 ($Config{'osname'} eq 'VMS' or - $Config{'osname'} eq 'OS2'); # "case-forgiving" +$origdir = cwd; +chdir dirname($0); +$file = basename($0, '.PL'); +$file .= '.com' if $^O eq 'VMS'; open OUT,">$file" or die "Can't create $file: $!"; @@ -26,9 +26,9 @@ print "Extracting $file (with variable substitutions)\n"; # You can use $Config{...} to use Configure variables. print OUT <<"!GROK!THIS!"; -$Config{'startperl'} - eval 'exec perl -S \$0 "\$@"' - if 0; +$Config{startperl} + eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' + if \$running_under_some_shell; !GROK!THIS! # In the following, perl variables are not expanded during extraction. @@ -57,7 +57,7 @@ It's just a first step, but it's usually a good first step. =head1 AUTHOR -Larry Wall +Larry Wall =cut @@ -386,3 +386,4 @@ y 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;