This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl.h: Add comments
[perl5.git] / utils / splain.PL
index cae84a0..28cf04b 100644 (file)
@@ -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 '.' }