summaryrefslogtreecommitdiff
path: root/regen
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 /regen
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 'regen')
-rwxr-xr-xregen/embed.pl2
-rw-r--r--regen/embed_lib.pl4
-rwxr-xr-xregen/feature.pl2
-rw-r--r--regen/mk_invlists.pl2
-rwxr-xr-xregen/opcode.pl2
-rw-r--r--regen/reentr.pl2
-rwxr-xr-xregen/regcharclass.pl2
-rw-r--r--regen/regcomp.pl2
-rw-r--r--regen/regen_lib.pl6
9 files changed, 12 insertions, 12 deletions
diff --git a/regen/embed.pl b/regen/embed.pl
index 01bcc78d15..ea77ecb106 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -238,7 +238,7 @@ sub readvars {
my ($file, $pre) = @_;
local (*FILE, $_);
my %seen;
- open(FILE, "< $file")
+ open(FILE, '<', $file)
or die "embed.pl: Can't open $file: $!\n";
while (<FILE>) {
s/[ \t]*#.*//; # Delete comments.
diff --git a/regen/embed_lib.pl b/regen/embed_lib.pl
index ca65f45001..af991cbdf4 100644
--- a/regen/embed_lib.pl
+++ b/regen/embed_lib.pl
@@ -55,7 +55,7 @@ sub add_level {
sub setup_embed {
my $prefix = shift || '';
- open IN, $prefix . 'embed.fnc' or die $!;
+ open IN, '<', $prefix . 'embed.fnc' or die $!;
my @embed;
my %seen;
@@ -104,7 +104,7 @@ sub setup_embed {
close IN or die "Problem reading embed.fnc: $!";
- open IN, $prefix . 'regen/opcodes' or die $!;
+ open IN, '<', $prefix . 'regen/opcodes' or die $!;
{
my %syms;
diff --git a/regen/feature.pl b/regen/feature.pl
index f8cf4a85f2..7a5671276e 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -107,7 +107,7 @@ my $HintShift;
my $HintMask;
my $Uni8Bit;
-open "perl.h", "perl.h" or die "$0 cannot open perl.h: $!";
+open "perl.h", "<", "perl.h" or die "$0 cannot open perl.h: $!";
while (readline "perl.h") {
next unless /#\s*define\s+(HINT_FEATURE_MASK|HINT_UNI_8_BIT)/;
my $is_u8b = $1 =~ 8;
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index d6ff165122..e4338463c4 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -2148,7 +2148,7 @@ my @sources = ($0, qw(lib/unicore/mktables
{
# Depend on mktables’ own sources. It’s a shorter list of files than
# those that Unicode::UCD uses.
- if (! open my $mktables_list, $sources_list) {
+ if (! open my $mktables_list, '<', $sources_list) {
# This should force a rebuild once $sources_list exists
push @sources, $sources_list;
diff --git a/regen/opcode.pl b/regen/opcode.pl
index 0bd62ced4b..c1c105fb26 100755
--- a/regen/opcode.pl
+++ b/regen/opcode.pl
@@ -45,7 +45,7 @@ my $oprivpm = open_new('lib/B/Op_private.pm', '>',
my %seen;
my (@ops, %desc, %check, %ckname, %flags, %args, %opnum);
-open OPS, 'regen/opcodes' or die $!;
+open OPS, '<', 'regen/opcodes' or die $!;
while (<OPS>) {
chop;
diff --git a/regen/reentr.pl b/regen/reentr.pl
index 564a68fb5e..802b8db90d 100644
--- a/regen/reentr.pl
+++ b/regen/reentr.pl
@@ -198,7 +198,7 @@ while (<DATA>) { # Read in the protoypes.
}
# If given the -U option open up the metaconfig unit for this function.
- if ($opts{U} && open(U, ">d_${func}_r.U")) {
+ if ($opts{U} && open(U, ">", "d_${func}_r.U")) {
binmode U;
}
diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl
index 3e2c8b4191..0009994bb0 100755
--- a/regen/regcharclass.pl
+++ b/regen/regcharclass.pl
@@ -1467,7 +1467,7 @@ EOF
{
# Depend on mktables’ own sources. It’s a shorter list of files than
# those that Unicode::UCD uses.
- if (! open my $mktables_list, $sources_list) {
+ if (! open my $mktables_list, '<', $sources_list) {
# This should force a rebuild once $sources_list exists
push @sources, $sources_list;
diff --git a/regen/regcomp.pl b/regen/regcomp.pl
index 94aa5729f2..88c0ac9b81 100644
--- a/regen/regcomp.pl
+++ b/regen/regcomp.pl
@@ -621,7 +621,7 @@ EOD
my $old_fh= select($guts);
$~= "GuTS";
- open my $oldguts, "pod/perldebguts.pod"
+ open my $oldguts, '<', 'pod/perldebguts.pod'
or die "$0 cannot open pod/perldebguts.pod for reading: $!";
while (<$oldguts>) {
print;
diff --git a/regen/regen_lib.pl b/regen/regen_lib.pl
index 184d86b40e..571f5195af 100644
--- a/regen/regen_lib.pl
+++ b/regen/regen_lib.pl
@@ -48,9 +48,9 @@ sub open_new {
if (-f $name) {
unlink $name or die "$name exists but can't unlink: $!";
}
- open $fh, ">$name" or die "Can't create $name: $!";
+ open $fh, '>', $name or die "Can't create $name: $!";
} elsif ($mode eq '>>') {
- open $fh, ">>$name" or die "Can't append to $name: $!";
+ open $fh, '>>', $name or die "Can't append to $name: $!";
} else {
die "Unhandled open mode '$mode'";
}
@@ -219,7 +219,7 @@ sub digest {
require Digest::SHA;
local ($/, *FH);
- open FH, "$file" or die "Can't open $file: $!";
+ open FH, '<', $file or die "Can't open $file: $!";
my $raw = <FH>;
close FH or die "Can't close $file: $!";
return Digest::SHA::sha256_hex($raw);