X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/cee96d52c39b1e7b36e1c62d38bcd8d86e9a41ab..61538b15f8baf714e68af9f1fb3fa085388de4a7:/utils/splain.PL diff --git a/utils/splain.PL b/utils/splain.PL index cae84a0..28cf04b 100644 --- a/utils/splain.PL +++ b/utils/splain.PL @@ -1,5 +1,8 @@ #!/usr/local/bin/perl +use strict; +use warnings; + use Config; use File::Basename qw(&basename &dirname); use File::Spec; @@ -15,17 +18,17 @@ use Cwd; # 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; +my $origdir = cwd; chdir dirname($0); -$file = basename($0, '.PL'); +my $file = basename($0, '.PL'); $file .= '.com' if $^O eq 'VMS'; # Open input file before creating output file. -$IN = File::Spec->catfile(File::Spec->updir, 'lib', 'diagnostics.pm'); -open IN or die "Can't open $IN: $!\n"; +my $in = File::Spec->catfile(File::Spec->updir, 'lib', 'diagnostics.pm'); +open IN, '<', $in or die "Can't open $in: $!\n"; # Create output file. -open OUT,">$file" or die "Can't create $file: $!"; +open OUT, '>', $file or die "Can't create $file: $!"; print "Extracting $file (with variable substitutions)\n"; @@ -35,10 +38,10 @@ print "Extracting $file (with variable substitutions)\n"; print OUT <<"!GROK!THIS!"; $Config{startperl} eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' - if \$running_under_some_shell; + if 0; # ^ Run only under a shell !GROK!THIS! -print <<'!NO!SUBS!'; +print OUT <<'!NO!SUBS!'; BEGIN { pop @INC if $INC[-1] eq '.' }