summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJohn Lightsey <lightsey@debian.org>2016-12-23 12:35:45 -0500
committerJames E Keenan <jkeenan@cpan.org>2016-12-23 13:52:28 -0500
commit1ae6ead94905dfee43773cf3b18949c91b33f9d1 (patch)
tree6a54545d46d1ae3f61696e23111a21c736b3b2b5 /utils
parent7527883f8c7b71d808abdbd3cff07f61280a42b5 (diff)
downloadperl-1ae6ead94905dfee43773cf3b18949c91b33f9d1.tar.gz
Switch most open() calls to three-argument form.
Switch from two-argument form. Filehandle cloning is still done with the two argument form for backward compatibility. Committer: Get all porting tests to pass. Increment some $VERSIONs. Run: ./perl -Ilib regen/mk_invlists.pl; ./perl -Ilib regen/regcharclass.pl For: RT #130122
Diffstat (limited to 'utils')
-rw-r--r--utils/c2ph.PL4
-rw-r--r--utils/corelist.PL4
-rw-r--r--utils/cpan.PL4
-rw-r--r--utils/enc2xs.PL4
-rw-r--r--utils/encguess.PL4
-rw-r--r--utils/h2ph.PL12
-rw-r--r--utils/h2xs.PL22
-rw-r--r--utils/instmodsh.PL4
-rw-r--r--utils/json_pp.PL4
-rw-r--r--utils/libnetcfg.PL2
-rw-r--r--utils/perlbug.PL2
-rw-r--r--utils/perldoc.PL2
-rw-r--r--utils/perlivp.PL2
-rw-r--r--utils/piconv.PL4
-rw-r--r--utils/pl2pm.PL4
-rw-r--r--utils/pod2html.PL2
-rw-r--r--utils/prove.PL4
-rw-r--r--utils/ptar.PL4
-rw-r--r--utils/ptardiff.PL4
-rw-r--r--utils/ptargrep.PL4
-rw-r--r--utils/shasum.PL4
-rw-r--r--utils/splain.PL6
-rw-r--r--utils/xsubpp.PL4
-rw-r--r--utils/zipdetails.PL4
24 files changed, 57 insertions, 57 deletions
diff --git a/utils/c2ph.PL b/utils/c2ph.PL
index c5b5a3f95b..7adc819931 100644
--- a/utils/c2ph.PL
+++ b/utils/c2ph.PL
@@ -40,7 +40,7 @@ chdir dirname($0);
$file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -1285,7 +1285,7 @@ sub fetch_template {
sub compute_intrinsics {
&safedir;
local($TMP) = "$SAFEDIR/c2ph-i.$$.c";
- open (TMP, ">$TMP") || die "can't open $TMP: $!";
+ open (TMP, ">", $TMP) || die "can't open $TMP: $!";
select(TMP);
print STDERR "computing intrinsic sizes: " if $trace;
diff --git a/utils/corelist.PL b/utils/corelist.PL
index 9bad7757b9..d1376bef4e 100644
--- a/utils/corelist.PL
+++ b/utils/corelist.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $script = File::Spec->catfile(
File::Spec->updir, qw[dist Module-CoreList]
), "corelist");
-if (open(IN, $script)) {
+if (open(IN, '<', $script)) {
print OUT <IN>;
close IN;
} else {
diff --git a/utils/cpan.PL b/utils/cpan.PL
index c7c26685db..f40c1c44df 100644
--- a/utils/cpan.PL
+++ b/utils/cpan.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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,7 +35,7 @@ use File::Spec;
my $cpan = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, qw(cpan CPAN scripts)), "cpan");
-if (open(CPAN, $cpan)) {
+if (open(CPAN, '<', $cpan)) {
print OUT <CPAN>;
close CPAN;
} else {
diff --git a/utils/enc2xs.PL b/utils/enc2xs.PL
index f50cdd7f6f..863ff8e9e7 100644
--- a/utils/enc2xs.PL
+++ b/utils/enc2xs.PL
@@ -21,7 +21,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ use File::Spec;
my $enc2xs = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "cpan", "Encode", "bin"), "enc2xs");
-if (open(ENC2XS, $enc2xs)) {
+if (open(ENC2XS, '<', $enc2xs)) {
print OUT <ENC2XS>;
close ENC2XS;
} else {
diff --git a/utils/encguess.PL b/utils/encguess.PL
index 81322f9c21..caa908f4b0 100644
--- a/utils/encguess.PL
+++ b/utils/encguess.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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,7 +35,7 @@ use File::Spec;
my $enc2xs = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "cpan", "Encode", "bin"), "encguess");
-if (open(ENC2XS, $enc2xs)) {
+if (open(ENC2XS, '<', $enc2xs)) {
print OUT <ENC2XS>;
close ENC2XS;
} else {
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 2523c0a654..db787499eb 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -19,7 +19,7 @@ chdir dirname($0);
$file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -119,8 +119,8 @@ while (defined (my $file = next_file())) {
}
}
- open(IN,"$file") || (($Exit = 1),(warn "Can't open $file: $!\n"),next);
- open(OUT,">$Dest_dir/$outfile") || die "Can't create $outfile: $!\n";
+ open(IN, "<", "$file") || (($Exit = 1),(warn "Can't open $file: $!\n"),next);
+ open(OUT, ">", "$Dest_dir/$outfile") || die "Can't create $outfile: $!\n";
}
print OUT
@@ -737,7 +737,7 @@ sub queue_includes_from
return if ($file eq "-");
- open HEADER, $file or return;
+ open HEADER, "<", $file or return;
while (defined($line = <HEADER>)) {
while (/\\$/) { # Handle continuation lines
chop $line;
@@ -777,7 +777,7 @@ sub build_preamble_if_necessary
# Can we skip building the preamble file?
if (-r $preamble) {
# Extract version number from first line of preamble:
- open PREAMBLE, $preamble or die "Cannot open $preamble: $!";
+ open PREAMBLE, "<", $preamble or die "Cannot open $preamble: $!";
my $line = <PREAMBLE>;
$line =~ /(\b\d+\b)/;
close PREAMBLE or die "Cannot close $preamble: $!";
@@ -788,7 +788,7 @@ sub build_preamble_if_necessary
my (%define) = _extract_cc_defines();
- open PREAMBLE, ">$preamble" or die "Cannot open $preamble: $!";
+ open PREAMBLE, ">", $preamble or die "Cannot open $preamble: $!";
print PREAMBLE "# This file was created by h2ph version $VERSION\n";
# Prevent non-portable hex constants from warning.
#
diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index f9063cbc4e..92dce0d346 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -842,7 +842,7 @@ if( @path_h ){
# Scan the header file (we should deal with nested header files)
# Record the names of simple #define constants into const_names
# Function prototypes are processed below.
- open(CH, "<$rel_path_h") || die "Can't open $rel_path_h: $!\n";
+ open(CH, "<", "$rel_path_h") || die "Can't open $rel_path_h: $!\n";
defines:
while (<CH>) {
if ($pre_sub_tri_graphs) {
@@ -975,7 +975,7 @@ if( ! $opt_X ){ # use XS, unless it was disabled
Devel::PPPort::WriteFile('ppport.h')
|| die "Can't create $ext$modpname/ppport.h: $!\n";
}
- open(XS, ">$modfname.xs") || die "Can't create $ext$modpname/$modfname.xs: $!\n";
+ open(XS, ">", "$modfname.xs") || die "Can't create $ext$modpname/$modfname.xs: $!\n";
if ($opt_x) {
warn "Scanning typemaps...\n";
get_typemap();
@@ -1093,7 +1093,7 @@ for (sort(keys(%const_names))) {
}
-d $modpmdir || mkpath([$modpmdir], 0, 0775);
-open(PM, ">$modpmname") || die "Can't create $ext$modpname/$modpmname: $!\n";
+open(PM, ">", "$modpmname") || die "Can't create $ext$modpname/$modpmname: $!\n";
$" = "\n\t";
warn "Writing $ext$modpname/$modpmname\n";
@@ -1779,7 +1779,7 @@ sub get_typemap {
warn " Scanning $typemap\n";
warn("Warning: ignoring non-text typemap file '$typemap'\n"), next
unless -T $typemap ;
- open(TYPEMAP, $typemap)
+ open(TYPEMAP, "<", $typemap)
or warn ("Warning: could not open typemap file '$typemap': $!\n"), next;
my $mode = 'Typemap';
while (<TYPEMAP>) {
@@ -1872,7 +1872,7 @@ close XS;
if (%types_seen) {
my $type;
warn "Writing $ext$modpname/typemap\n";
- open TM, ">typemap" or die "Cannot open typemap file for write: $!";
+ open TM, ">", "typemap" or die "Cannot open typemap file for write: $!";
for $type (sort keys %types_seen) {
my $entry = assign_typemap_entry $type;
@@ -1906,7 +1906,7 @@ EOP
} # if( ! $opt_X )
warn "Writing $ext$modpname/Makefile.PL\n";
-open(PL, ">Makefile.PL") || die "Can't create $ext$modpname/Makefile.PL: $!\n";
+open(PL, ">", "Makefile.PL") || die "Can't create $ext$modpname/Makefile.PL: $!\n";
my $prereq_pm = '';
@@ -2032,7 +2032,7 @@ close(PL) || die "Can't close $ext$modpname/Makefile.PL: $!\n";
# Create a simple README since this is a CPAN requirement
# and it doesn't hurt to have one
warn "Writing $ext$modpname/README\n";
-open(RM, ">README") || die "Can't create $ext$modpname/README:$!\n";
+open(RM, ">", "README") || die "Can't create $ext$modpname/README:$!\n";
my $thisyear = (gmtime)[5] + 1900;
my $rmhead = "$modpname version $TEMPLATE_VERSION";
my $rmheadeq = "=" x length($rmhead);
@@ -2099,7 +2099,7 @@ unless (-d "$testdir") {
warn "Writing $ext$modpname/$testfile\n";
my $tests = @const_names ? 2 : 1;
-open EX, ">$testfile" or die "Can't create $ext$modpname/$testfile: $!\n";
+open EX, ">", "$testfile" or die "Can't create $ext$modpname/$testfile: $!\n";
print EX <<_END_;
# Before 'make install' is performed this script should be runnable with
@@ -2205,7 +2205,7 @@ close(EX) || die "Can't close $ext$modpname/$testfile: $!\n";
unless ($opt_C) {
warn "Writing $ext$modpname/Changes\n";
$" = ' ';
- open(EX, ">Changes") || die "Can't create $ext$modpname/Changes: $!\n";
+ open(EX, ">", "Changes") || die "Can't create $ext$modpname/Changes: $!\n";
@ARGS = map {/[\s\"\'\`\$*?^|&<>\[\]\{\}\(\)]/ ? "'$_'" : $_} @ARGS;
print EX <<EOP;
Revision history for Perl extension $module.
@@ -2219,7 +2219,7 @@ EOP
}
warn "Writing $ext$modpname/MANIFEST\n";
-open(MANI,'>MANIFEST') or die "Can't create MANIFEST: $!";
+open(MANI, '>', 'MANIFEST') or die "Can't create MANIFEST: $!";
my @files = grep { -f } (<*>, <t/*>, <$fallbackdirname/*>, <$modpmdir/*>);
if (!@files) {
eval {opendir(D,'.');};
diff --git a/utils/instmodsh.PL b/utils/instmodsh.PL
index 08a47b7de8..a1e7b55b70 100644
--- a/utils/instmodsh.PL
+++ b/utils/instmodsh.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $instmodsh
qw(cpan ExtUtils-MakeMaker bin)),
'instmodsh');
-if (open(INSTMODSH, $instmodsh)) {
+if (open(INSTMODSH, '<', $instmodsh)) {
print OUT <INSTMODSH>;
close INSTMODSH;
} else {
diff --git a/utils/json_pp.PL b/utils/json_pp.PL
index 72c2e90785..efd8e23b0c 100644
--- a/utils/json_pp.PL
+++ b/utils/json_pp.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $script = File::Spec->catfile(
File::Spec->updir, qw[cpan JSON-PP bin]
), "json_pp");
-if (open(IN, $script)) {
+if (open(IN, '<', $script)) {
print OUT <IN>;
close IN;
} else {
diff --git a/utils/libnetcfg.PL b/utils/libnetcfg.PL
index 26d2f995a9..f66e9b0acb 100644
--- a/utils/libnetcfg.PL
+++ b/utils/libnetcfg.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
diff --git a/utils/perlbug.PL b/utils/perlbug.PL
index b0b2c12905..2a440cdec3 100644
--- a/utils/perlbug.PL
+++ b/utils/perlbug.PL
@@ -20,7 +20,7 @@ chdir dirname($0);
$file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-open OUT, ">$file" or die "Can't create $file: $!";
+open OUT, ">", $file or die "Can't create $file: $!";
# get patchlevel.h timestamp
diff --git a/utils/perldoc.PL b/utils/perldoc.PL
index cd60bd4354..afaa5a9a3f 100644
--- a/utils/perldoc.PL
+++ b/utils/perldoc.PL
@@ -29,7 +29,7 @@ warn "How odd, I'm going to generate $file_shortname?!"
$file .= '.com' if $^O eq 'VMS';
-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";
diff --git a/utils/perlivp.PL b/utils/perlivp.PL
index 81f8ae428e..50d187a544 100644
--- a/utils/perlivp.PL
+++ b/utils/perlivp.PL
@@ -20,7 +20,7 @@ my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
# 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";
diff --git a/utils/piconv.PL b/utils/piconv.PL
index ca8a8cfb7e..4e012d3dc3 100644
--- a/utils/piconv.PL
+++ b/utils/piconv.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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,7 +35,7 @@ use File::Spec;
my $piconv = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "cpan", "Encode", "bin"), "piconv");
-if (open(PICONV, $piconv)) {
+if (open(PICONV, '<', $piconv)) {
print OUT <PICONV>;
close PICONV;
} else {
diff --git a/utils/pl2pm.PL b/utils/pl2pm.PL
index b7e1cea30d..19aef581ab 100644
--- a/utils/pl2pm.PL
+++ b/utils/pl2pm.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
$file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -126,7 +126,7 @@ while (<>) {
$export_ok = "\@EXPORT_OK = qw(@export_ok);\n";
}
- if ( open(PM, ">$newname") ) {
+ if ( open(PM, ">", $newname) ) {
print PM <<"END";
package $newpack;
use 5.006;
diff --git a/utils/pod2html.PL b/utils/pod2html.PL
index 696624f163..eafd8f6665 100644
--- a/utils/pod2html.PL
+++ b/utils/pod2html.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
diff --git a/utils/prove.PL b/utils/prove.PL
index 17c4a7607e..61b8efc8a5 100644
--- a/utils/prove.PL
+++ b/utils/prove.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -36,7 +36,7 @@ use File::Spec;
my $prove = File::Spec->catfile(File::Spec->catdir(File::Spec->updir,
"cpan", "Test-Harness", "bin"), "prove");
-if (open(PROVE, $prove)) {
+if (open(PROVE, '<', $prove)) {
print OUT <PROVE>;
close PROVE;
} else {
diff --git a/utils/ptar.PL b/utils/ptar.PL
index 66242e3cc4..5dbf61b312 100644
--- a/utils/ptar.PL
+++ b/utils/ptar.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $script = File::Spec->catfile(
File::Spec->updir, qw[cpan Archive-Tar bin]
), "ptar");
-if (open(IN, $script)) {
+if (open(IN, '<', $script)) {
print OUT <IN>;
close IN;
} else {
diff --git a/utils/ptardiff.PL b/utils/ptardiff.PL
index e68f11ff08..8daefe258a 100644
--- a/utils/ptardiff.PL
+++ b/utils/ptardiff.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $script = File::Spec->catfile(
File::Spec->updir, qw[cpan Archive-Tar bin]
), "ptardiff");
-if (open(IN, $script)) {
+if (open(IN, '<', $script)) {
print OUT <IN>;
close IN;
} else {
diff --git a/utils/ptargrep.PL b/utils/ptargrep.PL
index 99d66a6718..b8b0830dea 100644
--- a/utils/ptargrep.PL
+++ b/utils/ptargrep.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $script = File::Spec->catfile(
File::Spec->updir, qw[cpan Archive-Tar bin]
), "ptargrep");
-if (open(IN, $script)) {
+if (open(IN, '<', $script)) {
print OUT <IN>;
close IN;
} else {
diff --git a/utils/shasum.PL b/utils/shasum.PL
index 852e6d21b7..afdbb48fe2 100644
--- a/utils/shasum.PL
+++ b/utils/shasum.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $script = File::Spec->catfile(
File::Spec->updir, qw[cpan Digest-SHA]
), "shasum");
-if (open(IN, $script)) {
+if (open(IN, '<', $script)) {
print OUT <IN>;
close IN;
} else {
diff --git a/utils/splain.PL b/utils/splain.PL
index bbcdad6f1e..ccf325de93 100644
--- a/utils/splain.PL
+++ b/utils/splain.PL
@@ -21,11 +21,11 @@ $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";
+$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";
diff --git a/utils/xsubpp.PL b/utils/xsubpp.PL
index 0331d4a136..450275ba10 100644
--- a/utils/xsubpp.PL
+++ b/utils/xsubpp.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $xsubpp = File::Spec->catfile(File::Spec->catdir(File::Spec->updir,
lib ExtUtils)),
'xsubpp');
-if (open(XSUBPP, $xsubpp)) {
+if (open(XSUBPP, '<', $xsubpp)) {
print OUT <XSUBPP>;
close XSUBPP;
} else {
diff --git a/utils/zipdetails.PL b/utils/zipdetails.PL
index a905c4befb..0fbdf83877 100644
--- a/utils/zipdetails.PL
+++ b/utils/zipdetails.PL
@@ -18,7 +18,7 @@ chdir dirname($0);
my $file = basename($0, '.PL');
$file .= '.com' if $^O eq 'VMS';
-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";
@@ -38,7 +38,7 @@ my $script = File::Spec->catfile(
File::Spec->updir, qw[ cpan IO-Compress bin ]
), "zipdetails");
-if (open(IN, $script)) {
+if (open(IN, '<', $script)) {
print OUT <IN>;
close IN;
} else {