Switch most open() calls to three-argument form

Programming / Compilers / PERL - John Lightsey [debian.org] - 23 December 2016 13:52 EST

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

###

diff --git a/Cross/generate_config_sh b/Cross/generate_config_sh
index e47042a..203885e 100755
--- a/Cross/generate_config_sh
+++ b/Cross/generate_config_sh
@@ -44,7 +44,7 @@ if ($config eq "") {
die("Please run me as generate_config_sh path/to/original/config.sh");
}

-open(FILE, "$config") || die("Unable to open $config");
+open(FILE, '<', $config) || die("Unable to open $config");

my $line_in;
while ($line_in = ) {
diff --git a/NetWare/config_h.PL b/NetWare/config_h.PL
index d0eb05a..67d5bc3 100644
--- a/NetWare/config_h.PL
+++ b/NetWare/config_h.PL
@@ -19,7 +19,7 @@ $patchlevel =~ s|~VERSION~|$Config{version}|g;
$patchlevel ||= $Config{version};
$patchlevel = qq["$patchlevel"];

-open(SH,"<$name") || die "Cannot open $name:$!";
+open(SH,'<',$name) || die "Cannot open $name:$!";
while ()
{
last if /^sed/;
@@ -42,7 +42,7 @@ eval $str;

die "$str:$@" if $@;

-open(H,">$file.new") || die "Cannot open $file.new:$!";
+open(H,'>',"$file.new") || die "Cannot open $file.new:$!";
binmode H; # no CRs (which cause a spurious rebuild)
while ()
{
diff --git a/NetWare/config_sh.PL b/NetWare/config_sh.PL
index 0e1d351..d2daf0e 100644
--- a/NetWare/config_sh.PL
+++ b/NetWare/config_sh.PL
@@ -18,7 +18,7 @@ sub loadopts {
shift @ARGV;
my $optfile = shift @ARGV;
local (*F);
- open OPTF, $optfile or die "Can't open $optfile: $!\n";
+ open OPTF, '<', $optfile or die "Can't open $optfile: $!\n";
my @opts;
chomp(my $line = );
my @vars = split(/\t+~\t+/, $line);
@@ -43,7 +43,7 @@ while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) {
my $pl_h = '../patchlevel.h';

if (-e $pl_h) {
- open PL, "<$pl_h" or die "Can't open $pl_h: $!";
+ open PL, '<', $pl_h or die "Can't open $pl_h: $!";
while () {
if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) {
$opt{$1} = $2;
diff --git a/NetWare/t/NWModify.pl b/NetWare/t/NWModify.pl
index 4e98174..fa58b47 100644
--- a/NetWare/t/NWModify.pl
+++ b/NetWare/t/NWModify.pl
@@ -85,7 +85,7 @@ sub Process_File
# Do the processing only if the file has '.t' extension.
if($ext eq '.t') {

- open(FH, "+< $FileToProcess") or die "Unable to open the file, $FileToProcess for reading and writing.\n";
+ open(FH, '+<', $FileToProcess) or die "Unable to open the file, $FileToProcess for reading and writing.\n";
@ARRAY = ; # Get the contents of the file into an array.

foreach $Line(@ARRAY) # Get each line of the file.
diff --git a/NetWare/t/NWScripts.pl b/NetWare/t/NWScripts.pl
index c16a4a1..5f21244 100644
--- a/NetWare/t/NWScripts.pl
+++ b/NetWare/t/NWScripts.pl
@@ -30,7 +30,7 @@ foreach $DirItem(@Dirs)
# Open once in write mode since later files are opened in append mode,
# and if there already exists a file with the same name, all further opens
# will append to that file!!
- open(FHW, "> $IntAutoScript") or die "Unable to open the file, $IntAutoScript for writing.\n";
+ open(FHW, '>', $IntAutoScript) or die "Unable to open the file, $IntAutoScript for writing.\n";
seek(FHW, 0, 0); # seek to the beginning of the file.
close FHW; # close the file.
}
@@ -39,7 +39,7 @@ foreach $DirItem(@Dirs)

print "Generating t/nwauto.pl ...\n\n\n";

-open(FHWA, "> t/nwauto.pl") or die "Unable to open the file, t/nwauto.pl for writing.\n";
+open(FHWA, '>', 't/nwauto.pl') or die "Unable to open the file, t/nwauto.pl for writing.\n";
seek(FHWA, 0, 0); # seek to the beginning of the file.

$version = sprintf("%vd",$^V);
@@ -67,7 +67,7 @@ foreach $FileName(@DirNames)
}

# Write into the intermediary auto script.
- open(FHW, ">> $IntAutoScript") or die "Unable to open the file, $IntAutoScript for appending.\n";
+ open(FHW, '>>', $IntAutoScript) or die "Unable to open the file, $IntAutoScript for appending.\n";
seek(FHW, 0, 2); # seek to the end of the file.

$pos = tell(FHW);
@@ -164,7 +164,7 @@ foreach $DirItem(@Dirs)
$IntAutoScript = "t/".$DirItem.".pl";

# Write into the intermediary auto script.
- open(FHW, ">> $IntAutoScript") or die "Unable to open the file, $IntAutoScript for appending.\n";
+ open(FHW, '>>', $IntAutoScript) or die "Unable to open the file, $IntAutoScript for appending.\n";
seek(FHW, 0, 2); # seek to the end of the file.

# Write into the intermediary auto script.
diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm
index ef56abb..1c52829 100644
--- a/Porting/Maintainers.pm
+++ b/Porting/Maintainers.pm
@@ -22,7 +22,7 @@ use vars qw(@ISA @EXPORT_OK $VERSION);
show_results process_options files_to_modules
finish_tap_output
reload_manifest);
-$VERSION = 0.11;
+$VERSION = 0.12;

require Exporter;

@@ -41,7 +41,7 @@ sub reload_manifest {
$manifest_path = "../MANIFEST";
}

- if (open(my $manfh, $manifest_path )) {
+ if (open(my $manfh, '<', $manifest_path )) {
while (<$manfh>) {
if (/^(\S+)/) {
$MANIFEST{$1}++;
diff --git a/Porting/add-package.pl b/Porting/add-package.pl
index ee03c45..012aa77 100755
--- a/Porting/add-package.pl
+++ b/Porting/add-package.pl
@@ -374,7 +374,7 @@ my @ChangedFiles;
### update the manifest
{ my $file = $Repo . '/MANIFEST';
my @manifest;
- { open my $fh, "<$file" or die "Could not open $file: $!";
+ { open my $fh, '<', $file or die "Could not open $file: $!";
@manifest = <$fh>;
close $fh;
}
@@ -414,7 +414,7 @@ my @ChangedFiles;
push @manifest, values %pkg_files;

{ chmod 0644, $file;
- open my $fh, ">$file" or die "Could not open $file for writing: $!";
+ open my $fh, '>', $file or die "Could not open $file for writing: $!";
#print $fh sort { lc $a cmp lc $b } @manifest;
### XXX stolen from pod/buildtoc:sub do_manifest
print $fh
diff --git a/Porting/check83.pl b/Porting/check83.pl
index 64eac95..fbe5655 100755
--- a/Porting/check83.pl
+++ b/Porting/check83.pl
@@ -45,7 +45,7 @@ sub eight_dot_three {

my %dir;

-if (open(MANIFEST, "MANIFEST")) {
+if (open(MANIFEST, '<', 'MANIFEST')) {
while () {
chomp;
s/\s.+//;
diff --git a/Porting/checkAUTHORS.pl b/Porting/checkAUTHORS.pl
index 4204304..56fb39e 100755
--- a/Porting/checkAUTHORS.pl
+++ b/Porting/checkAUTHORS.pl
@@ -215,7 +215,7 @@ sub read_authors_files {
return unless (@authors);
my (%count, %raw);
foreach my $filename (@authors) {
- open FH, "<$filename" or die "Can't open $filename: $!";
+ open FH, '<', $filename or die "Can't open $filename: $!";
binmode FH, ':encoding(UTF-8)';
while () {
next if /^\#/;
@@ -661,6 +661,7 @@ jasons\100cs.unm.edu jasons\100sandy-home.arc.unm.edu
jbuehler\100hekimian.com jhpb\100hekimian.com
jcromie\100100divsol.com jcromie\100cpan.org
+ jim.cromie\100gmail.com
+jd\100cpanel.net lightsey\100debian.org
jdhedden\100cpan.org jerry\100hedden.us
+ jdhedden\1001979.usna.com
+ jdhedden\100gmail.com
diff --git a/Porting/checkVERSION.pl b/Porting/checkVERSION.pl
index 9ad2ff5..d63c34e 100755
--- a/Porting/checkVERSION.pl
+++ b/Porting/checkVERSION.pl
@@ -24,7 +24,7 @@ sub parse_file {

my $result;

- open(FH,$parsefile) or warn "Could not open '$parsefile': $!";
+ open(FH,'<',$parsefile) or warn "Could not open '$parsefile': $!";

my $inpod = 0;
while () {
diff --git a/Porting/checkansi.pl b/Porting/checkansi.pl
index c072b28..f16691a 100755
--- a/Porting/checkansi.pl
+++ b/Porting/checkansi.pl
@@ -50,7 +50,7 @@ for my $k (keys %{$limits{$opt{std}}}) {
find(sub {
/\.([ch]|xs)$/ or return;

- my $fh = IO::File->new($_) or die "$_: $!\n";
+ my $fh = IO::File->new($_, 'r') or die "$_: $!\n";
my $ll = '';

while (defined(my $line = <$fh>)) {
diff --git a/Porting/checkcfguse.pl b/Porting/checkcfguse.pl
index af3dd12..986d4f9 100755
--- a/Porting/checkcfguse.pl
+++ b/Porting/checkcfguse.pl
@@ -47,7 +47,7 @@ my @PAT =
print STDERR "$0: Looking for symbols...\n";
for my $pat (@PAT) {
for my $fn (map { glob($_) } @{ $pat->[0] }) {
- if (open(my $fh, $fn)) {
+ if (open(my $fh, '<', $fn)) {
while (<$fh>) {
for my $p (@$pat) {
for my $sym (/$p/g) {
@@ -70,7 +70,7 @@ delete $SYM{'const'};

my $SYM = join("|", sort { length($b) <=> length($a) || $a cmp $b } keys %SYM);

-open(my $mani, "MANIFEST") or die "$0: Failed to open MANIFEST\n";
+open(my $mani, '<', "MANIFEST") or die "$0: Failed to open MANIFEST\n";

my %found;
while (<$mani>) {
@@ -80,7 +80,7 @@ while (<$mani>) {
# from metaconfig generated files that refer to
# the config symbols, and from pods.
next if $fn =~ m{^(?:config_h.SH|Configure|configure\.com|Porting/(?:config|Glossary)|(?:NetWare|plan9|win32)/(?:config|(?:GNU)?[Mm]akefile)|uconfig)|\.pod$};
- open my $fh, $fn or die qq[$0: Failed to open $fn: $!];
+ open my $fh, '<', $fn or die qq[$0: Failed to open $fn: $!];
while (<$fh>) {
while (/\b($SYM)\b/go) {
$found{$1}{$fn}++;
diff --git a/Porting/config_h.pl b/Porting/config_h.pl
index 82f40d9..8ac1582 100755
--- a/Porting/config_h.pl
+++ b/Porting/config_h.pl
@@ -15,7 +15,7 @@ use strict;
use warnings;

my ($cSH, $ch, @ch, %ch) = ("config_h.SH");
-open $ch, "<$cSH" or die "Cannot open $cSH: $!\n";
+open $ch, '<', $cSH or die "Cannot open $cSH: $!\n";
{ local $/ = "\n\n";
@ch = <$ch>;
close $ch;
@@ -68,7 +68,7 @@ for (grep m{echo .Extracting \$CONFIG_H} => @ch) {
push @ch, ";;\nesac\n";


-open $ch, "> $cSH" or die "Cannot write $cSH: $!\n";
+open $ch, '>', $cSH or die "Cannot write $cSH: $!\n";
print $ch < #!/bin/sh
#
diff --git a/Porting/corecpan.pl b/Porting/corecpan.pl
index 3a38d11..75b18ab 100755
--- a/Porting/corecpan.pl
+++ b/Porting/corecpan.pl
@@ -58,7 +58,7 @@ our $opt_f || !-f $packagefile and get_package_details;

# Load the package details. All of them.
my %cpanversions;
-open my $fh, $packagefile or die $!;
+open my $fh, '<', $packagefile or die $!;
while (<$fh>) {
my ($p, $v) = split ' ';
next if 1../^\s*$/; # skip header
diff --git a/Porting/leakfinder.pl b/Porting/leakfinder.pl
index c22a58e..370ae5c 100644
--- a/Porting/leakfinder.pl
+++ b/Porting/leakfinder.pl
@@ -31,9 +31,9 @@ for(`find .`) {
=~ s/\0/'."\\0".'/grid;
$prog = < open oUt, ">&", STDOUT;
- open STDOUT, ">/dev/null";
- open STDIN, "- open STDERR, ">/dev/null";
+ open STDOUT, ">", "/dev/null";
+ open STDIN, "<", "/dev/null";
+ open STDERR, ">", "/dev/null";
\$unused_variable = '$q';
eval \$unused_variable while \$also_unused++ < 4;
print oUt sv_count, "\n";
diff --git a/Porting/makerel b/Porting/makerel
index 0bf7990..53ecdc2 100755
--- a/Porting/makerel
+++ b/Porting/makerel
@@ -48,7 +48,7 @@ $relroot = defined $opts{r} ? $opts{r} : "..";
die "Must be in root of the perl source tree.\n"
unless -f "./MANIFEST" and -f "patchlevel.h";

-open PATCHLEVEL,"+open PATCHLEVEL, '<', 'patchlevel.h' or die;
my @patchlevel_h = ;
close PATCHLEVEL;
my $patchlevel_h = join "", grep { /^#\s*define/ } @patchlevel_h;
diff --git a/Porting/manicheck b/Porting/manicheck
index 1b506d9..b544a12 100644
--- a/Porting/manicheck
+++ b/Porting/manicheck
@@ -8,7 +8,7 @@ use strict;
use warnings;
use File::Find;

-open my $fh, 'MANIFEST' or die "Can't read MANIFEST: $!\n";
+open my $fh, '<', 'MANIFEST' or die "Can't read MANIFEST: $!\n";
my @files = map { (split)[0] } <$fh>;
close $fh;
for (@files) {
diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan
index d0cc1d6..6484c17 100755
--- a/Porting/sync-with-cpan
+++ b/Porting/sync-with-cpan
@@ -290,7 +290,7 @@ Archive::Tar->extract_archive( $new_file );
# ensure 'make' will update all files
my $t= time;
for my $file (find_type_f($new_dir)) {
- open(my $fh,">>$file") || die "Cannot write $file:$!";
+ open(my $fh,'>>',$file) || die "Cannot write $file:$!";
close($fh);
utime($t,$t,$file);
};
diff --git a/autodoc.pl b/autodoc.pl
index 597607c..2e6a1c3 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -355,7 +355,7 @@ open my $fh, '<', 'MANIFEST'
while (my $line = <$fh>) {
next unless my ($file) = $line =~ /^(\S+\.[ch])\t/;

- open F, "< $file" or die "Cannot open $file for docs: $!\n";
+ open F, '<', $file or die "Cannot open $file for docs: $!\n";
$curheader = "Functions in file $file\n";
autodoc(\*F,$file);
close F or die "Error closing $file: $!\n";
diff --git a/charclass_invlists.h b/charclass_invlists.h
index 3f14119..9838bed 100644
--- a/charclass_invlists.h
+++ b/charclass_invlists.h
@@ -91515,7 +91515,7 @@ static const U8 WB_table[24][24] = {
#endif /* defined(PERL_IN_REGEXEC_C) */

/* Generated from:
- * f1951e655fd5fa35478f641663ef164146d743362998b01378327afac5f20270 lib/Unicode/UCD.pm
+ * 59e717586b720a821ee0d7397679d5322e38b49f6fb7840545aedf669c733b70 lib/Unicode/UCD.pm
* 47cb62a53beea6d0263e2147331c7e751853c9327225d95bbe2d9e1dc3e1aa44 lib/unicore/ArabicShaping.txt
* 153f0a100c315f9f3945e78f57137611d36c44b3a975919c499fd403413fede8 lib/unicore/BidiBrackets.txt
* fbe806975c1bf9fc9960bbaa39ff6290c42c7da8315f9cd459109b024cc1c485 lib/unicore/BidiMirroring.txt
@@ -91561,5 +91561,5 @@ static const U8 WB_table[24][24] = {
* 066d6e75f95cf6794161c8ac0b1a40990277de90eefb913be2e675a7cba38d59 lib/unicore/mktables
* cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version
* 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
- * 6697977221bf632720408ca9a1a934e43d5d8e51c870532cec3ebdb3e3ba80c6 regen/mk_invlists.pl
+ * ed40040566a4f1d6b0d912dda2159c1460e0093b318d90626ab9aa513a53b15d regen/mk_invlists.pl
* ex: set ro: */
diff --git a/configpm b/configpm
index d2ba35c..877bff1 100755
--- a/configpm
+++ b/configpm
@@ -216,7 +216,7 @@ my $quote;
my %seen_quotes;
{
my ($name, $val);
- open(CONFIG_SH, $Config_SH) || die "Can't open $Config_SH: $!";
+ open(CONFIG_SH, '<', $Config_SH) || die "Can't open $Config_SH: $!";
while () {
next if m:^#!/bin/sh:;

@@ -527,7 +527,7 @@ $heavy_txt .= join('', @non_v) . "\n";

# copy config summary format from the myconfig.SH script
$heavy_txt .= "our \$summary = <<'!END!';\n";
-open(MYCONFIG,"+open(MYCONFIG,'<','myconfig.SH') || die "open myconfig.SH failed: $!";
1 while defined($_ = ) && !/^Summary of/;
do { $heavy_txt .= $_ } until !defined($_ = ) || /^\s*$/;
close(MYCONFIG);
@@ -632,7 +632,7 @@ foreach my $prefix (qw(libs libswanted)) {
$heavy_txt .= "${prefix}_nolargefiles='$value'\n";
}

-if (open(my $fh, "cflags")) {
+if (open(my $fh, '<', 'cflags')) {
my $ccwarnflags;
my $ccstdflags;
while (<$fh>) {
@@ -838,7 +838,7 @@ tie %%Config, 'Config', {
ENDOFTIE


-open(CONFIG_POD, ">$Config_POD") or die "Can't open $Config_POD: $!";
+open(CONFIG_POD, '>', $Config_POD) or die "Can't open $Config_POD: $!";
print CONFIG_POD <<'ENDOFTAIL';
=head1 NAME

@@ -991,7 +991,7 @@ in such cases.
ENDOFTAIL

if ($Opts{glossary}) {
- open(GLOS, "<$Glossary") or die "Can't open $Glossary: $!";
+ open(GLOS, '<', $Glossary) or die "Can't open $Glossary: $!";
}
my %seen = ();
my $text = 0;
diff --git a/dist/Devel-SelfStubber/lib/Devel/SelfStubber.pm b/dist/Devel-SelfStubber/lib/Devel/SelfStubber.pm
index e47cd3a..781dd9f 100644
--- a/dist/Devel-SelfStubber/lib/Devel/SelfStubber.pm
+++ b/dist/Devel-SelfStubber/lib/Devel/SelfStubber.pm
@@ -4,7 +4,7 @@ require SelfLoader;
@ISA = qw(SelfLoader);
@EXPORT = 'AUTOLOAD';
$JUST_STUBS = 1;
-$VERSION = 1.05;
+$VERSION = 1.06;
sub Version {$VERSION}

# Use as
@@ -39,7 +39,7 @@ sub stub {
my (@BEFORE_DATA, @AFTER_DATA, @AFTER_END);
@DATA = @STUBS = ();

- open($fh,$mod_file) || die "Unable to open $mod_file";
+ open($fh,'<',$mod_file) || die "Unable to open $mod_file";
local $/ = "\n";
while(defined ($line = <$fh>) and $line !~ m/^__DATA__/) {
push(@BEFORE_DATA,$line);
diff --git a/dist/Devel-SelfStubber/t/Devel-SelfStubber.t b/dist/Devel-SelfStubber/t/Devel-SelfStubber.t
index 4d69090..48e27cd 100644
--- a/dist/Devel-SelfStubber/t/Devel-SelfStubber.t
+++ b/dist/Devel-SelfStubber/t/Devel-SelfStubber.t
@@ -30,7 +30,7 @@ while () {
my $f = $1;
my $file = catfile(curdir(),$inlib,$f);
push @cleanup, $file;
- open FH, ">$file" or die $!;
+ open FH, '>', $file or die $!;
} else {
print FH;
}
@@ -40,14 +40,14 @@ close FH;
{
my $file = "A-$$";
push @cleanup, $file;
- open FH, ">$file" or die $!;
+ open FH, '>', $file or die $!;
select FH;
Devel::SelfStubber->stub('xChild', $inlib);
select STDOUT;
print "ok 1\n";
close FH or die $!;

- open FH, $file or die $!;
+ open FH, '<', $file or die $!;
my @A = ;

if (@A == 1 && $A[0] =~ /^\s*sub\s+xChild::foo\s*;\s*$/) {
@@ -61,14 +61,14 @@ close FH;
{
my $file = "B-$$";
push @cleanup, $file;
- open FH, ">$file" or die $!;
+ open FH, '>', $file or die $!;
select FH;
Devel::SelfStubber->stub('Proto', $inlib);
select STDOUT;
print "ok 3\n"; # Checking that we did not die horribly.
close FH or die $!;

- open FH, $file or die $!;
+ open FH, '<', $file or die $!;
my @B = ;

if (@B == 1 && $B[0] =~ /^\s*sub\s+Proto::bar\s*\(\$\$\);\s*$/) {
@@ -84,14 +84,14 @@ close FH;
{
my $file = "C-$$";
push @cleanup, $file;
- open FH, ">$file" or die $!;
+ open FH, '>', $file or die $!;
select FH;
Devel::SelfStubber->stub('Attribs', $inlib);
select STDOUT;
print "ok 5\n"; # Checking that we did not die horribly.
close FH or die $!;

- open FH, $file or die $!;
+ open FH, '<', $file or die $!;
my @C = ;

if (@C == 2 && $C[0] =~ /^\s*sub\s+Attribs::baz\s+:\s*locked\s*;\s*$/
@@ -137,7 +137,7 @@ sub faildump {
foreach my $module (@module) {
my $file = "$module--$$";
push @cleanup, $file;
- open FH, ">$file" or die $!;
+ open FH, '>', $file or die $!;
print FH "use $module;
print ${module}->foo;
";
@@ -168,11 +168,11 @@ undef $/;
foreach my $module (@module, 'Data', 'End') {
my $file = catfile(curdir(),$lib,"$module.pm");
my $fileo = catfile(curdir(),$inlib,"$module.pm");
- open FH, $fileo or die "Can't open $fileo: $!";
+ open FH, '<', $fileo or die "Can't open $fileo: $!";
my $contents = ;
close FH or die $!;
push @cleanup, $file;
- open FH, ">$file" or die $!;
+ open FH, '>', $file or die $!;
select FH;
if ($contents =~ /__DATA__/) {
# This will die for any module with no __DATA__
@@ -208,7 +208,7 @@ system "$runperl -w \"-I$lib\" \"-MData\" -e \"Data::ok\"";
system "$runperl -w \"-I$lib\" \"-MEnd\" -e \"End::lime\"";

# But check that the documentation after the __END__ survived.
-open FH, catfile(curdir(),$lib,"End.pm") or die $!;
+open FH, '<', catfile(curdir(),$lib,"End.pm") or die $!;
$_ = ;
close FH or die $!;

diff --git a/dist/Dumpvalue/t/Dumpvalue.t b/dist/Dumpvalue/t/Dumpvalue.t
index 8e9da19..64cf52e 100644
--- a/dist/Dumpvalue/t/Dumpvalue.t
+++ b/dist/Dumpvalue/t/Dumpvalue.t
@@ -189,7 +189,7 @@ is( $out->read, "\%baz = (\n 'one' => 1, 'two' => 2\n)\n",
'dumped glob for %baz fine' );

SKIP: {
- skip( "Couldn't open $0 for reading", 1 ) unless open(FILE, $0);
+ skip( "Couldn't open $0 for reading", 1 ) unless open(FILE, '<', $0);
my $fileno = fileno(FILE);
$d->dumpglob( '', 0, 'FILE', *FILE );
is( $out->read, "FileHandle(FILE) => fileno($fileno)\n",
diff --git a/dist/ExtUtils-CBuilder/t/01-basic.t b/dist/ExtUtils-CBuilder/t/01-basic.t
index b99382f..3db8581 100644
--- a/dist/ExtUtils-CBuilder/t/01-basic.t
+++ b/dist/ExtUtils-CBuilder/t/01-basic.t
@@ -33,7 +33,7 @@ ok $b->have_compiler, "have_compiler";
$source_file = File::Spec->catfile('t', 'basict.c');
{
local *FH;
- open FH, "> $source_file" or die "Can't create $source_file: $!";
+ open FH, '>', $source_file or die "Can't create $source_file: $!";
print FH "int boot_basict(void) { return 1; }\n";
close FH;
}
diff --git a/dist/ExtUtils-CBuilder/t/02-link.t b/dist/ExtUtils-CBuilder/t/02-link.t
index 0c64619..6160c26 100644
--- a/dist/ExtUtils-CBuilder/t/02-link.t
+++ b/dist/ExtUtils-CBuilder/t/02-link.t
@@ -33,7 +33,7 @@ ok $b, "created EU::CB object";

$source_file = File::Spec->catfile('t', 'linkt.c');
{
- open my $FH, "> $source_file" or die "Can't create $source_file: $!";
+ open my $FH, '>', $source_file or die "Can't create $source_file: $!";
print $FH "int main(void) { return 11; }\n";
close $FH;
}
diff --git a/dist/ExtUtils-CBuilder/t/03-cplusplus.t b/dist/ExtUtils-CBuilder/t/03-cplusplus.t
index 78290d3..0c05ae2 100644
--- a/dist/ExtUtils-CBuilder/t/03-cplusplus.t
+++ b/dist/ExtUtils-CBuilder/t/03-cplusplus.t
@@ -32,7 +32,7 @@ ok $b->have_cplusplus, "have_cplusplus";

$source_file = File::Spec->catfile('t', 'cplust.cc');
{
- open my $FH, "> $source_file" or die "Can't create $source_file: $!";
+ open my $FH, '>', $source_file or die "Can't create $source_file: $!";
print $FH "class Bogus { public: int boot_cplust() { return 1; } };\n";
close $FH;
}
diff --git a/dist/I18N-LangTags/lib/I18N/LangTags.pm b/dist/I18N-LangTags/lib/I18N/LangTags.pm
index 2193208..c4d9cea 100644
--- a/dist/I18N-LangTags/lib/I18N/LangTags.pm
+++ b/dist/I18N-LangTags/lib/I18N/LangTags.pm
@@ -19,7 +19,7 @@ require Exporter;
);
%EXPORT_TAGS = ('ALL' => \@EXPORT_OK);

-$VERSION = "0.41";
+$VERSION = "0.42";

sub uniq { my %seen; return grep(!($seen{$_}++), @_); } # a util function

@@ -460,7 +460,7 @@ interaction looks like:
So far so good. But suppose the way you're implementing this is:

my %greetings;
- die unless open(IN, "+ die unless open(IN, "<", "in.dat");
while() {
chomp;
next unless /^([^=]+)=(.+)/s;
@@ -502,7 +502,7 @@ program with:

use I18N::LangTags qw(encode_language_tag);
my %greetings;
- die unless open(IN, "+ die unless open(IN, "<", "in.dat");
while() {
chomp;
next unless /^([^=]+)=(.+)/s;
diff --git a/dist/IO/Makefile.PL b/dist/IO/Makefile.PL
index 7783cf9..383eccb 100644
--- a/dist/IO/Makefile.PL
+++ b/dist/IO/Makefile.PL
@@ -20,7 +20,7 @@ unless ($PERL_CORE or exists $Config{'i_poll'}) {
}

if ($] < 5.008 and !$PERL_CORE) {
- open(FH,">typemap");
+ open(FH,'>','typemap');
print FH "const char * T_PV\n";
close(FH);
}
diff --git a/dist/IO/t/IO.t b/dist/IO/t/IO.t
index 2551b24..247940f 100644
--- a/dist/IO/t/IO.t
+++ b/dist/IO/t/IO.t
@@ -93,7 +93,7 @@ my $fakemod = File::Spec->catfile( $fakedir, 'fakemod.pm' );
my $flag;
if ( -d $fakedir or mkpath( $fakedir ))
{
- if (open( OUT, ">$fakemod"))
+ if (open( OUT, '>', $fakemod ))
{
(my $package = <<' END_HERE') =~ tr/\t//d;
package IO::fakemod;
diff --git a/dist/IO/t/io_dir.t b/dist/IO/t/io_dir.t
index 5472daa..dc8eb43 100644
--- a/dist/IO/t/io_dir.t
+++ b/dist/IO/t/io_dir.t
@@ -42,7 +42,7 @@ ok(!$dot->rewind, "rewind on closed");
ok(!defined($dot->read));
}

-open(FH,'>X') || die "Can't create x";
+open(FH,'>','X') || die "Can't create x";
print FH "X";
close(FH) or die "Can't close: $!";

diff --git a/dist/IO/t/io_file.t b/dist/IO/t/io_file.t
index 1cf60f5..a3d79c9 100644
--- a/dist/IO/t/io_file.t
+++ b/dist/IO/t/io_file.t
@@ -16,7 +16,7 @@ can_ok( $Class, "binmode" );
### use standard open to make sure we can compare binmodes
### on both.
{ my $tmp;
- open $tmp, ">$File" or die "Could not open '$File': $!";
+ open $tmp, '>', $File or die "Could not open '$File': $!";
binmode $tmp;
print $tmp $All_Chars;
close $tmp;
diff --git a/dist/IO/t/io_linenum.t b/dist/IO/t/io_linenum.t
index 2d44f50..734854b 100644
--- a/dist/IO/t/io_linenum.t
+++ b/dist/IO/t/io_linenum.t
@@ -26,7 +26,7 @@ sub lineno

my $t;

-open (F, $File) or die $!;
+open (F, '<', $File) or die $!;
my $io = IO::File->new($File) or die $!;

for (1 .. 10);
diff --git a/dist/IO/t/io_sock.t b/dist/IO/t/io_sock.t
index c9c443b..630b856 100644
--- a/dist/IO/t/io_sock.t
+++ b/dist/IO/t/io_sock.t
@@ -214,7 +214,7 @@ if ( $^O eq 'qnx' ) {
### the client. We'll use own source code ...
#
local @data;
-if( !open( SRC, "< $0")) {
+if( !open( SRC, '<', $0)) {
print "not ok 15 - $!\n";
} else {
@data = ;
diff --git a/dist/IO/t/io_unix.t b/dist/IO/t/io_unix.t
index 61ba363..a6cd05c 100644
--- a/dist/IO/t/io_unix.t
+++ b/dist/IO/t/io_unix.t
@@ -39,7 +39,7 @@ if ($^O eq 'os2') { # Can't create sockets with relative path...
}

# Test if we can create the file within the tmp directory
-if (-e $PATH or not open(TEST, ">$PATH") and $^O ne 'os2') {
+if (-e $PATH or not open(TEST, '>', $PATH) and $^O ne 'os2') {
print "1..0 # Skip: cannot open '$PATH' for write\n";
exit 0;
}
diff --git a/dist/Safe/t/safe2.t b/dist/Safe/t/safe2.t
index fc519ff..b3f2dac 100644
--- a/dist/Safe/t/safe2.t
+++ b/dist/Safe/t/safe2.t
@@ -131,7 +131,7 @@ like($@, qr/foo bar/);

$! = 0;
my $nosuch = '/non/existent/file.name';
-open(NOSUCH, $nosuch);
+open(NOSUCH, '<', $nosuch);
if ($@) {
my $errno = $!;
die "Eek! Attempting to open $nosuch failed, but \$! is still 0" unless $!;
diff --git a/dist/Search-Dict/t/Dict.t b/dist/Search-Dict/t/Dict.t
index bc997b0..21b226e 100644
--- a/dist/Search-Dict/t/Dict.t
+++ b/dist/Search-Dict/t/Dict.t
@@ -38,7 +38,7 @@ EOT
use Tie::Handle; # loads Tie::StdHandle
use Search::Dict;

-open(DICT, "+>dict-$$") or die "Can't create dict-$$: $!";
+open(DICT, '+>', "dict-$$") or die "Can't create dict-$$: $!";
binmode DICT; # To make length expected one.
print DICT $DICT;

diff --git a/dist/Storable/Storable.pm b/dist/Storable/Storable.pm
index 7101641..246957f 100644
--- a/dist/Storable/Storable.pm
+++ b/dist/Storable/Storable.pm
@@ -22,7 +22,7 @@ package Storable; @ISA = qw(Exporter);

use vars qw($canonical $forgive_me $VERSION);

-$VERSION = '2.59';
+$VERSION = '2.60';

BEGIN {
if (eval {
@@ -119,7 +119,7 @@ sub file_magic {

my $file = shift;
my $fh = IO::File->new;
- open($fh, "<". $file) || die "Can't open '$file': $!";
+ open($fh, "<", $file) || die "Can't open '$file': $!";
binmode($fh);
defined(sysread($fh, my $buf, 32)) || die "Can't read from '$file': $!";
close($fh);
@@ -245,7 +245,7 @@ sub _store {
logcroak "wrong argument number" unless @_ == 2; # No @foo in arglist
local *FILE;
if ($use_locking) {
- open(FILE, ">>$file") || logcroak "can't write into $file: $!";
+ open(FILE, '>>', $file) || logcroak "can't write into $file: $!";
unless (&CAN_FLOCK) {
logcarp
"Storable::lock_store: fcntl/flock emulation broken on $^O";
@@ -256,7 +256,7 @@ sub _store {
truncate FILE, 0;
# Unlocking will happen when FILE is closed
} else {
- open(FILE, ">$file") || logcroak "can't create $file: $!";
+ open(FILE, '>', $file) || logcroak "can't create $file: $!";
}
binmode FILE; # Archaic systems...
my $da = $@; # Don't mess if called from exception handler
@@ -373,7 +373,7 @@ sub lock_retrieve {
sub _retrieve {
my ($file, $use_locking) = @_;
local *FILE;
- open(FILE, $file) || logcroak "can't open $file: $!";
+ open(FILE, '<', $file) || logcroak "can't open $file: $!";
binmode FILE; # Archaic systems...
my $self;
my $da = $@; # Could be from exception handler
diff --git a/dist/Storable/t/code.t b/dist/Storable/t/code.t
index 7fc40ba..d31e231 100644
--- a/dist/Storable/t/code.t
+++ b/dist/Storable/t/code.t
@@ -71,7 +71,7 @@ local *FOO;

\&dclone, # XS function

- sub { open FOO, "/" },
+ sub { open FOO, '<', "/" },
);

$Storable::Deparse = 1;
@@ -191,7 +191,7 @@ is(prototype($thawed->[4]), prototype($obj[0]->[4]));
my $devnull = File::Spec->devnull;

open(SAVEERR, ">&STDERR");
- open(STDERR, ">$devnull") or
+ open(STDERR, '>', $devnull) or
( print SAVEERR "Unable to redirect STDERR: $!\n" and exit(1) );

eval { $freezed = freeze $obj[0]->[0] };
diff --git a/dist/Storable/t/compat01.t b/dist/Storable/t/compat01.t
index 2827676..56d7df6 100644
--- a/dist/Storable/t/compat01.t
+++ b/dist/Storable/t/compat01.t
@@ -33,7 +33,7 @@ my $testno;
for my $dump (@dumps) {
$testno++;

- open(FH, ">$file") || die "Can't create $file: $!";
+ open(FH, '>', $file) || die "Can't create $file: $!";
binmode(FH);
print FH $dump;
close(FH) || die "Can't write $file: $!";
diff --git a/dist/Storable/t/destroy.t b/dist/Storable/t/destroy.t
index e9464fb..dcc3600 100644
--- a/dist/Storable/t/destroy.t
+++ b/dist/Storable/t/destroy.t
@@ -7,7 +7,7 @@ BEGIN {
package foo;
sub new { return bless {} }
DESTROY {
- open FH, "+ open FH, '<', "foo" or die $!;
eval { Storable::pretrieve(*FH); };
close FH or die $!;
unlink "foo";
diff --git a/dist/Storable/t/file_magic.t b/dist/Storable/t/file_magic.t
index 5dc032d..a68665d 100644
--- a/dist/Storable/t/file_magic.t
+++ b/dist/Storable/t/file_magic.t
@@ -441,7 +441,7 @@ nstore({}, $file);

for my $test (@tests) {
my($data, $expected) = @$test;
- open(FH, ">$file") || die "Can't create $file: $!";
+ open(FH, '>', $file) || die "Can't create $file: $!";
binmode(FH);
print FH $data;
close(FH) || die "Can't write $file: $!";
diff --git a/dist/Storable/t/forgive.t b/dist/Storable/t/forgive.t
index c994211..af7aa1d 100644
--- a/dist/Storable/t/forgive.t
+++ b/dist/Storable/t/forgive.t
@@ -45,7 +45,7 @@ $Storable::forgive_me=1;
my $devnull = File::Spec->devnull;

open(SAVEERR, ">&STDERR");
-open(STDERR, ">$devnull") or
+open(STDERR, '>', $devnull) or
( print SAVEERR "Unable to redirect STDERR: $!\n" and exit(1) );

eval {$result = store ($bad , 'store')};
diff --git a/dist/Storable/t/testlib.pl b/dist/Storable/t/testlib.pl
index 6d885d7..9b07dd4 100644
--- a/dist/Storable/t/testlib.pl
+++ b/dist/Storable/t/testlib.pl
@@ -12,7 +12,7 @@ use Storable qw (store retrieve freeze thaw nstore nfreeze);
sub slurp {
my $file = shift;
local (*FH, $/);
- open FH, "<$file" or die "Can't open '$file': $!";
+ open FH, '<', $file or die "Can't open '$file': $!";
binmode FH;
my $contents = ;
die "Can't read $file: $!" unless defined $contents;
@@ -22,7 +22,7 @@ sub slurp {
sub store_and_retrieve {
my $data = shift;
unlink $file or die "Can't unlink '$file': $!";
- open FH, ">$file" or die "Can't open '$file': $!";
+ open FH, '>', $file or die "Can't open '$file': $!";
binmode FH;
print FH $data or die "Can't print to '$file': $!";
close FH or die "Can't close '$file': $!";
@@ -35,4 +35,4 @@ sub freeze_and_thaw {
return eval {thaw $data};
}

-$file;
+1;
diff --git a/dist/Term-ReadLine/lib/Term/ReadLine.pm b/dist/Term-ReadLine/lib/Term/ReadLine.pm
index db08947..88d5a75 100644
--- a/dist/Term-ReadLine/lib/Term/ReadLine.pm
+++ b/dist/Term-ReadLine/lib/Term/ReadLine.pm
@@ -269,9 +269,8 @@ sub new {

# the Windows CONIN$ needs GENERIC_WRITE mode to allow
# a SetConsoleMode() if we end up using Term::ReadKey
- open FIN, ( $^O eq 'MSWin32' && $console eq 'CONIN$' ) ? "+<$console" :
- "<$console";
- open FOUT,">$consoleOUT";
+ open FIN, (( $^O eq 'MSWin32' && $console eq 'CONIN$' ) ? '+<' : '<' ), $console;
+ open FOUT,'>', $consoleOUT;

#OUT->autoflush(1); # Conflicts with debugger?
my $sel = select(FOUT);
@@ -320,7 +319,7 @@ sub Features { \%features }

package Term::ReadLine; # So late to allow the above code be defined?

-our $VERSION = '1.15';
+our $VERSION = '1.16';

my ($which) = exists $ENV{PERL_RL} ? split /\s+/, $ENV{PERL_RL} : undef;
if ($which) {
diff --git a/dist/Test/lib/Test.pm b/dist/Test/lib/Test.pm
index 84db5f3..ce544ff 100644
--- a/dist/Test/lib/Test.pm
+++ b/dist/Test/lib/Test.pm
@@ -20,7 +20,7 @@ sub _reset_globals {
$planned = 0;
}

-$VERSION = '1.29';
+$VERSION = '1.30';
require Exporter;
@ISA=('Exporter');

@@ -199,7 +199,7 @@ sub _read_program {
my($file) = shift;
return unless defined $file and length $file
and -e $file and -f _ and -r _;
- open(SOURCEFILE, "<$file") || return;
+ open(SOURCEFILE, '<', $file) || return;
$Program_Lines{$file} = [];
close(SOURCEFILE);

@@ -346,7 +346,7 @@ If either (or both!) is a subroutine reference, it is run and used
as the value for comparing. For example:

ok sub {
- open(OUT, ">x.dat") || die $!;
+ open(OUT, '>', 'x.dat') || die $!;
print OUT "\x{e000}";
close OUT;
my $bytecount = -s 'x.dat';
@@ -540,7 +540,7 @@ sub _diff_complain_external {
if (close($got_fh) && close($exp_fh)) {
my $diff_cmd = "$diff $exp_filename $got_filename";
print $TESTERR "#\n# $prefix $diff_cmd\n";
- if (open(DIFF, "$diff_cmd |")) {
+ if (open(DIFF, '-|', $diff_cmd)) {
local $_;
while () {
print $TESTERR "# $prefix $_";
diff --git a/dist/Test/t/mix.t b/dist/Test/t/mix.t
index 5298338..12607d7 100644
--- a/dist/Test/t/mix.t
+++ b/dist/Test/t/mix.t
@@ -6,7 +6,7 @@ use Test qw(:DEFAULT $TESTOUT $TESTERR $ntest);
### seeing the todo tests, otherwise you get people sending in bug reports
### about Test.pm having "UNEXPECTEDLY SUCCEEDED" tests.

-open F, ">mix";
+open F, ">", "mix";
$TESTOUT = *F{IO};
$TESTERR = *F{IO};

@@ -31,7 +31,7 @@ $TESTOUT = *STDOUT{IO};
$TESTERR = *STDERR{IO};
$ntest = 1;

-open F, "mix";
+open F, "<", "mix";
my $out = join '', ;
close F;
unlink "mix";
diff --git a/dist/Test/t/onfail.t b/dist/Test/t/onfail.t
index 85fe9eb..dd6b83e 100644
--- a/dist/Test/t/onfail.t
+++ b/dist/Test/t/onfail.t
@@ -10,7 +10,7 @@ $mycnt = 0;

my $why = "zero != one";
# sneak in a test that Test::Harness wont see
-open J, ">junk";
+open J, ">", "junk";
$TESTOUT = *J{IO};
$TESTERR = *J{IO};
ok(0, 1, $why);
diff --git a/dist/Test/t/todo.t b/dist/Test/t/todo.t
index 74f9aef..8d3d794 100644
--- a/dist/Test/t/todo.t
+++ b/dist/Test/t/todo.t
@@ -6,7 +6,7 @@ use Test qw(:DEFAULT $TESTOUT $TESTERR $ntest);
### seeing the todo tests, otherwise you get people sending in bug reports
### about Test.pm having "UNEXPECTEDLY SUCCEEDED" tests.

-open F, ">todo";
+open F, ">", "todo";
$TESTOUT = *F{IO};
$TESTERR = *F{IO};
my $tests = 5;
@@ -25,7 +25,7 @@ $TESTOUT = *STDOUT{IO};
$TESTERR = *STDERR{IO};
$ntest = 1;

-open F, "todo";
+open F, "<", "todo";
my $out = join '', ;
close F;
unlink "todo";
diff --git a/dist/Tie-File/t/01_gen.t b/dist/Tie-File/t/01_gen.t
index 202b09c..e9504d3 100644
--- a/dist/Tie-File/t/01_gen.t
+++ b/dist/Tie-File/t/01_gen.t
@@ -119,7 +119,7 @@ sub check_contents {
my $x = join $:, @c, '';
local *FH = $o->{fh};
seek FH, 0, SEEK_SET;
-# my $open = open FH, "< $file";
+# my $open = open FH, "<", $file;
my $a;
{ local $/; $a = }
$a = "" unless defined $a;
diff --git a/dist/Tie-File/t/02_fetchsize.t b/dist/Tie-File/t/02_fetchsize.t
index 12d2b51..146a91a 100644
--- a/dist/Tie-File/t/02_fetchsize.t
+++ b/dist/Tie-File/t/02_fetchsize.t
@@ -10,7 +10,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/03_longfetch.t b/dist/Tie-File/t/03_longfetch.t
index 7d5a388..63dad4f 100644
--- a/dist/Tie-File/t/03_longfetch.t
+++ b/dist/Tie-File/t/03_longfetch.t
@@ -18,7 +18,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/04_splice.t b/dist/Tie-File/t/04_splice.t
index b3880b7..8d23c58 100644
--- a/dist/Tie-File/t/04_splice.t
+++ b/dist/Tie-File/t/04_splice.t
@@ -222,7 +222,7 @@ check_contents("0$:1$:2$:");

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/05_size.t b/dist/Tie-File/t/05_size.t
index 44c69f9..72774c8 100644
--- a/dist/Tie-File/t/05_size.t
+++ b/dist/Tie-File/t/05_size.t
@@ -16,7 +16,7 @@ use Tie::File;
print "ok $N\n"; $N++;

# 2-3 FETCHSIZE 0-length file
-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
close F;
$o = tie @a, 'Tie::File', $file;
@@ -34,7 +34,7 @@ undef $o;
untie @a;

my $data = "rec0$:rec1$:rec2$:";
-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/07_rv_splice.t b/dist/Tie-File/t/07_rv_splice.t
index e5c09b1..141383a 100644
--- a/dist/Tie-File/t/07_rv_splice.t
+++ b/dist/Tie-File/t/07_rv_splice.t
@@ -177,7 +177,7 @@ check_result();

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/08_ro.t b/dist/Tie-File/t/08_ro.t
index 5fd8933..a38e7fa 100644
--- a/dist/Tie-File/t/08_ro.t
+++ b/dist/Tie-File/t/08_ro.t
@@ -30,7 +30,7 @@ for my $i (0..$#items) {

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
@@ -56,7 +56,7 @@ if (setup_badly_terminated_file(4)) {

sub setup_badly_terminated_file {
my $NTESTS = shift;
- open F, "> $file" or die "Couldn't open $file: $!";
+ open F, '>', $file or die "Couldn't open $file: $!";
binmode F;
print F $badrec;
close F;
diff --git a/dist/Tie-File/t/09_gen_rs.t b/dist/Tie-File/t/09_gen_rs.t
index e590210..88d8250 100644
--- a/dist/Tie-File/t/09_gen_rs.t
+++ b/dist/Tie-File/t/09_gen_rs.t
@@ -161,7 +161,7 @@ if (setup_badly_terminated_file(1)) {

sub setup_badly_terminated_file {
my $NTESTS = shift;
- open F, "> $file" or die "Couldn't open $file: $!";
+ open F, '>', $file or die "Couldn't open $file: $!";
binmode F;
print F $badrec;
close F;
diff --git a/dist/Tie-File/t/10_splice_rs.t b/dist/Tie-File/t/10_splice_rs.t
index 50b8b0a..da981db 100644
--- a/dist/Tie-File/t/10_splice_rs.t
+++ b/dist/Tie-File/t/10_splice_rs.t
@@ -175,7 +175,7 @@ check_contents("");

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/11_rv_splice_rs.t b/dist/Tie-File/t/11_rv_splice_rs.t
index ae10538..2fc9f2c 100644
--- a/dist/Tie-File/t/11_rv_splice_rs.t
+++ b/dist/Tie-File/t/11_rv_splice_rs.t
@@ -154,7 +154,7 @@ check_result(0..3);

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/12_longfetch_rs.t b/dist/Tie-File/t/12_longfetch_rs.t
index 6f1905d..4e5d57b 100644
--- a/dist/Tie-File/t/12_longfetch_rs.t
+++ b/dist/Tie-File/t/12_longfetch_rs.t
@@ -15,7 +15,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/13_size_rs.t b/dist/Tie-File/t/13_size_rs.t
index a2a8d53..b2e534c 100644
--- a/dist/Tie-File/t/13_size_rs.t
+++ b/dist/Tie-File/t/13_size_rs.t
@@ -17,7 +17,7 @@ use Tie::File;
print "ok $N\n"; $N++;

# 2-3 FETCHSIZE 0-length file
-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
close F;
$o = tie @a, 'Tie::File', $file, recsep => 'blah';
print $o ? "ok $N\n" : "not ok $N\n";
@@ -31,7 +31,7 @@ undef $o;
untie @a;

# 4-5 FETCHSIZE positive-length file
-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
print F $data;
close F;
$o = tie @a, 'Tie::File', $file, recsep => 'blah';
diff --git a/dist/Tie-File/t/14_lock.t b/dist/Tie-File/t/14_lock.t
index cab4812..c523458 100644
--- a/dist/Tie-File/t/14_lock.t
+++ b/dist/Tie-File/t/14_lock.t
@@ -29,7 +29,7 @@ use Tie::File;
print "ok $N\n"; $N++;

# 2-4 Who the heck knows?
-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
close F;
$o = tie @a, 'Tie::File', $file, recsep => 'blah';
print $o ? "ok $N\n" : "not ok $N\n";
diff --git a/dist/Tie-File/t/16_handle.t b/dist/Tie-File/t/16_handle.t
index f799496..21a3fce 100644
--- a/dist/Tie-File/t/16_handle.t
+++ b/dist/Tie-File/t/16_handle.t
@@ -117,7 +117,7 @@ sub check_contents {
my $x = join $:, @c, '';
local *FH = $o->{fh};
seek FH, 0, SEEK_SET;
-# my $open = open FH, "< $file";
+# my $open = open FH, '<', $file;
my $a;
{ local $/; $a = }
$a = "" unless defined $a;
diff --git a/dist/Tie-File/t/19_cache.t b/dist/Tie-File/t/19_cache.t
index 81c6932..a8b6e69 100644
--- a/dist/Tie-File/t/19_cache.t
+++ b/dist/Tie-File/t/19_cache.t
@@ -15,7 +15,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
@@ -169,7 +169,7 @@ check();

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/20_cache_full.t b/dist/Tie-File/t/20_cache_full.t
index 8b3bf0b..bd4d6a7 100644
--- a/dist/Tie-File/t/20_cache_full.t
+++ b/dist/Tie-File/t/20_cache_full.t
@@ -14,7 +14,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
@@ -192,7 +192,7 @@ check();

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/21_win32.t b/dist/Tie-File/t/21_win32.t
index d068544..0ccf669 100644
--- a/dist/Tie-File/t/21_win32.t
+++ b/dist/Tie-File/t/21_win32.t
@@ -31,7 +31,7 @@ my $n;
@a = qw(fish dog carrot);
undef $o;
untie @a;
-open F, "< $file" or die "Couldn't open file $file: $!";
+open F, '<', $file or die "Couldn't open file $file: $!";
binmode F;
my $a = do {local $/ ; };
my $x = "fish\r\ndog\r\ncarrot\r\n" ;
diff --git a/dist/Tie-File/t/22_autochomp.t b/dist/Tie-File/t/22_autochomp.t
index dee07a8..ebf3eac 100644
--- a/dist/Tie-File/t/22_autochomp.t
+++ b/dist/Tie-File/t/22_autochomp.t
@@ -105,7 +105,7 @@ sub check_contents {
my $x = join $:, @c, '';
local *FH = $o->{fh};
seek FH, 0, SEEK_SET;
-# my $open = open FH, "< $file";
+# my $open = open FH, '<', $file;
my $a;
{ local $/; $a = }
$a = "" unless defined $a;
diff --git a/dist/Tie-File/t/23_rv_ac_splice.t b/dist/Tie-File/t/23_rv_ac_splice.t
index be22957..104045a 100644
--- a/dist/Tie-File/t/23_rv_ac_splice.t
+++ b/dist/Tie-File/t/23_rv_ac_splice.t
@@ -155,7 +155,7 @@ check_result(0..3);

sub init_file {
my $data = shift;
- open F, "> $file" or die $!;
+ open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/24_cache_loop.t b/dist/Tie-File/t/24_cache_loop.t
index 0bc66be..42c002c 100644
--- a/dist/Tie-File/t/24_cache_loop.t
+++ b/dist/Tie-File/t/24_cache_loop.t
@@ -19,7 +19,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/25_gen_nocache.t b/dist/Tie-File/t/25_gen_nocache.t
index 78e5506..ce55d27 100644
--- a/dist/Tie-File/t/25_gen_nocache.t
+++ b/dist/Tie-File/t/25_gen_nocache.t
@@ -91,7 +91,7 @@ sub check_contents {
my $x = join $:, @c, '';
local *FH = $o->{fh};
seek FH, 0, SEEK_SET;
-# my $open = open FH, "< $file";
+# my $open = open FH, '<', $file;
my $a;
{ local $/; $a = }
$a = "" unless defined $a;
diff --git a/dist/Tie-File/t/26_twrite.t b/dist/Tie-File/t/26_twrite.t
index e2a925f..d827f1c 100644
--- a/dist/Tie-File/t/26_twrite.t
+++ b/dist/Tie-File/t/26_twrite.t
@@ -27,7 +27,7 @@ $: = Tie::File::_default_recsep();
# The problem was premature termination in the inner loop
# because you had $more_data scoped *inside* the block instead of outside.
# 20020331
-open F, "> $file" or die "Couldn't open $file: $!";
+open F, '>', $file or die "Couldn't open $file: $!";
binmode F;
for (1..100) {
print F "$_ ", 'a'x150, $: ;
@@ -263,7 +263,7 @@ try(42000, 0, 0); # old=0 , new=0 ; old = new

sub try {
my ($pos, $len, $newlen) = @_;
- open F, "> $file" or die "Couldn't open file $file: $!";
+ open F, '>', $file or die "Couldn't open file $file: $!";
binmode F;

# The record has exactly 17 characters. This will help ensure that
@@ -289,7 +289,7 @@ sub try {
$o->_twrite($newdata, $pos, $len);
undef $o; untie @lines;

- open F, "< $file" or die "Couldn't open file $file: $!";
+ open F, '<', $file or die "Couldn't open file $file: $!";
binmode F;
my $actual;
{ local $/;
@@ -313,7 +313,7 @@ sub check_contents {
my $x = join $:, @c, '';
local *FH = $o->{fh};
seek FH, 0, SEEK_SET;
-# my $open = open FH, "< $file";
+# my $open = open FH, '<', $file;
my $a;
{ local $/; $a = }
$a = "" unless defined $a;
diff --git a/dist/Tie-File/t/27_iwrite.t b/dist/Tie-File/t/27_iwrite.t
index db591a8..04ad436 100644
--- a/dist/Tie-File/t/27_iwrite.t
+++ b/dist/Tie-File/t/27_iwrite.t
@@ -179,7 +179,7 @@ sub try {
my ($s, $len, $newlen) = @_;
my $e = $s + $len;

- open F, "> $file" or die "Couldn't open file $file: $!";
+ open F, '>', $file or die "Couldn't open file $file: $!";
binmode F;

print F $oldfile;
@@ -197,7 +197,7 @@ sub try {
my $actual_return = $o->_iwrite($newdata, $s, $e);
undef $o; untie @lines;

- open F, "< $file" or die "Couldn't open file $file: $!";
+ open F, '<', $file or die "Couldn't open file $file: $!";
binmode F;
my $actual;
{ local $/;
diff --git a/dist/Tie-File/t/28_mtwrite.t b/dist/Tie-File/t/28_mtwrite.t
index 50e306d..3146369 100644
--- a/dist/Tie-File/t/28_mtwrite.t
+++ b/dist/Tie-File/t/28_mtwrite.t
@@ -198,7 +198,7 @@ sub mkrand {
sub try {
push @TRIES, [@_] if @_ == 3;

- open F, "> $file" or die "Couldn't open file $file: $!";
+ open F, '>', $file or die "Couldn't open file $file: $!";
binmode F;
print F $oldfile;
close F;
@@ -220,7 +220,7 @@ sub try {
my $actual_return = $o->_mtwrite(@mt_args);
undef $o; untie @lines;

- open F, "< $file" or die "Couldn't open file $file: $!";
+ open F, '<', $file or die "Couldn't open file $file: $!";
binmode F;
my $actual;
{ local $/;
diff --git a/dist/Tie-File/t/29_downcopy.t b/dist/Tie-File/t/29_downcopy.t
index 51c941c..793116a 100644
--- a/dist/Tie-File/t/29_downcopy.t
+++ b/dist/Tie-File/t/29_downcopy.t
@@ -237,7 +237,7 @@ try(42000, 0, 0); # old=0 , new=0 ; old = new

sub try {
my ($pos, $len, $newlen) = @_;
- open F, "> $file" or die "Couldn't open file $file: $!";
+ open F, '>', $file or die "Couldn't open file $file: $!";
binmode F;

# The record has exactly 17 characters. This will help ensure that
@@ -291,7 +291,7 @@ sub try {
}
}

- open F, "< $file" or die "Couldn't open file $file: $!";
+ open F, '<', $file or die "Couldn't open file $file: $!";
binmode F;
my $actual;
{ local $/;
@@ -323,7 +323,7 @@ sub check_contents {
my $x = join $:, @c, '';
local *FH = $o->{fh};
seek FH, 0, SEEK_SET;
-# my $open = open FH, "< $file";
+# my $open = open FH, '<', $file;
my $a;
{ local $/; $a = }
$a = "" unless defined $a;
diff --git a/dist/Tie-File/t/29a_upcopy.t b/dist/Tie-File/t/29a_upcopy.t
index 1130615..9840af4 100644
--- a/dist/Tie-File/t/29a_upcopy.t
+++ b/dist/Tie-File/t/29a_upcopy.t
@@ -98,7 +98,7 @@ try($FLEN-20000, 200, undef);

sub try {
my ($src, $dst, $len) = @_;
- open F, "> $file" or die "Couldn't open file $file: $!";
+ open F, '>', $file or die "Couldn't open file $file: $!";
binmode F;

# The record has exactly 17 characters. This will help ensure that
@@ -141,7 +141,7 @@ sub try {
}
}

- open F, "< $file" or die "Couldn't open file $file: $!";
+ open F, '<', $file or die "Couldn't open file $file: $!";
binmode F;
my $actual;
{ local $/;
@@ -165,7 +165,7 @@ sub check_contents {
my $x = join $:, @c, '';
local *FH = $o->{fh};
seek FH, 0, SEEK_SET;
-# my $open = open FH, "< $file";
+# my $open = open FH, '<', $file;
my $a;
{ local $/; $a = }
$a = "" unless defined $a;
diff --git a/dist/Tie-File/t/30_defer.t b/dist/Tie-File/t/30_defer.t
index 063b3a7..975cdfb 100644
--- a/dist/Tie-File/t/30_defer.t
+++ b/dist/Tie-File/t/30_defer.t
@@ -19,7 +19,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
@@ -89,7 +89,7 @@ check_contents(join $:, "r0".."r2", "", "r4".."r6", "");
#
undef $o; untie @a;
$data = join "$:", map("record$_", 0..7), ""; # records are 8 or 9 bytes long
-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
@@ -221,7 +221,7 @@ check_contents(join("$:", qw(recordF recordB recordC
undef $o;
untie @a;
# (79) We can't use check_contents any more, because the object is dead
-open F, "< $file" or die;
+open F, '<', $file or die;
binmode F;
{ local $/ ; $z = }
close F;
diff --git a/dist/Tie-File/t/31_autodefer.t b/dist/Tie-File/t/31_autodefer.t
index ea929a4..baf72c2 100644
--- a/dist/Tie-File/t/31_autodefer.t
+++ b/dist/Tie-File/t/31_autodefer.t
@@ -19,7 +19,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/32_defer_misc.t b/dist/Tie-File/t/32_defer_misc.t
index e0e3f15..f4ee110 100644
--- a/dist/Tie-File/t/32_defer_misc.t
+++ b/dist/Tie-File/t/32_defer_misc.t
@@ -17,7 +17,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Tie-File/t/33_defer_vs.t b/dist/Tie-File/t/33_defer_vs.t
index 071af77..b68541c 100644
--- a/dist/Tie-File/t/33_defer_vs.t
+++ b/dist/Tie-File/t/33_defer_vs.t
@@ -21,7 +21,7 @@ my $N = 1;
use Tie::File;
print "ok $N\n"; $N++;

-open F, "> $file" or die $!;
+open F, '>', $file or die $!;
binmode F;
print F $data;
close F;
diff --git a/dist/Time-HiRes/Makefile.PL b/dist/Time-HiRes/Makefile.PL
index 9060fa2..ccad6a3 100644
--- a/dist/Time-HiRes/Makefile.PL
+++ b/dist/Time-HiRes/Makefile.PL
@@ -88,7 +88,7 @@ sub try_compile_and_link {
my $obj_ext = $Config{obj_ext} || ".o";
unlink("$tmp.c", "$tmp$obj_ext");

- if (open(TMPC, ">$tmp.c")) {
+ if (open(TMPC, '>', "$tmp.c")) {
print TMPC $c;
close(TMPC);

@@ -132,7 +132,7 @@ __EOD__
unless defined $cccmd;

if ($^O eq 'VMS') {
- open( CMDFILE, ">$tmp.com" );
+ open( CMDFILE, '>', "$tmp.com" );
print CMDFILE "\$ SET MESSAGE/NOFACILITY/NOSEVERITY/NOIDENT/NOTEXT\n";
print CMDFILE "\$ $cccmd\n";
print CMDFILE "\$ IF \$SEVERITY .NE. 1 THEN EXIT 44\n"; # escalate
@@ -864,7 +864,7 @@ EOM

if ($DEFINE) {
$DEFINE =~ s/^\s+//;
- if (open(XDEFINE, ">xdefine")) {
+ if (open(XDEFINE, '>', 'xdefine')) {
print XDEFINE $DEFINE, "\n";
close(XDEFINE);
}
@@ -1015,8 +1015,8 @@ sub doConstants {
foreach $file ('const-c.inc', 'const-xs.inc') {
my $fallback = File::Spec->catfile('fallback', $file);
local $/;
- open IN, "<$fallback" or die "Can't open $fallback: $!";
- open OUT, ">$file" or die "Can't open $file: $!";
+ open IN, '<', $fallback or die "Can't open $fallback: $!";
+ open OUT, '>', $file or die "Can't open $file: $!";
print OUT or die $!;
close OUT or die "Can't close $file: $!";
close IN or die "Can't close $fallback: $!";
@@ -1035,7 +1035,7 @@ sub main {
DEFINE('SELECT_IS_BROKEN');
$LIBS = [];
print "System is $^O, skipping full configure...\n";
- open(XDEFINE, ">xdefine") or die "$0: Cannot create xdefine: $!\n";
+ open(XDEFINE, '>', 'xdefine') or die "$0: Cannot create xdefine: $!\n";
close(XDEFINE);
} else {
init();
diff --git a/dist/Time-HiRes/t/alarm.t b/dist/Time-HiRes/t/alarm.t
index f600f99..4935410 100644
--- a/dist/Time-HiRes/t/alarm.t
+++ b/dist/Time-HiRes/t/alarm.t
@@ -10,7 +10,7 @@ use Config;
my $limit = 0.25; # 25% is acceptable slosh for testing timers

my $xdefine = '';
-if (open(XDEFINE, "xdefine")) {
+if (open(XDEFINE, "<", "xdefine")) {
chomp($xdefine = || "");
close(XDEFINE);
}
diff --git a/dist/Time-HiRes/t/sleep.t b/dist/Time-HiRes/t/sleep.t
index c4d802b..b84b4c6 100644
--- a/dist/Time-HiRes/t/sleep.t
+++ b/dist/Time-HiRes/t/sleep.t
@@ -8,7 +8,7 @@ BEGIN { require_ok "Time::HiRes"; }
use Config;

my $xdefine = '';
-if (open(XDEFINE, "xdefine")) {
+if (open(XDEFINE, "<", "xdefine")) {
chomp($xdefine = || "");
close(XDEFINE);
}
diff --git a/dist/Time-HiRes/t/stat.t b/dist/Time-HiRes/t/stat.t
index e7552b5..a59a342 100644
--- a/dist/Time-HiRes/t/stat.t
+++ b/dist/Time-HiRes/t/stat.t
@@ -20,7 +20,7 @@ my @atime;
my @mtime;
for (1..5) {
Time::HiRes::sleep(rand(0.1) + 0.1);
- open(X, ">$$");
+ open(X, '>', $$);
print X $$;
close(X);
my($a, $stat, $b) = ("a", [Time::HiRes::stat($$)], "b");
@@ -33,7 +33,7 @@ for (1..5) {
is $b, "b";
is_deeply $lstat, $stat;
Time::HiRes::sleep(rand(0.1) + 0.1);
- open(X, "<$$");
+ open(X, '<', $$);
;
close(X);
$stat = [Time::HiRes::stat($$)];
@@ -75,7 +75,7 @@ SKIP: {
my $targetname = "tgt$$";
my $linkname = "link$$";
SKIP: {
- open(X, ">$targetname");
+ open(X, '>', $targetname);
print X $$;
close(X);
eval { symlink $targetname, $linkname or die "can't symlink: $!"; };
diff --git a/dist/Time-HiRes/t/utime.t b/dist/Time-HiRes/t/utime.t
index e64f99b..f84bccf 100644
--- a/dist/Time-HiRes/t/utime.t
+++ b/dist/Time-HiRes/t/utime.t
@@ -25,10 +25,10 @@ BEGIN {
sub getfstype {
my ($fn) = @_;
my $cmd = "df $fn";
- open(my $df, "$cmd |") or die "$cmd: $!";
+ open(my $df, '-|', $cmd) or die "$cmd: $!";
my @df = <$df>; # Assume $df[0] is header line.
my $dev = +(split(" ", $df[1]))[0];
- open(my $mounts, "/proc/mounts") or die "/proc/mounts: $!";
+ open(my $mounts, '<', '/proc/mounts') or die "/proc/mounts: $!";
while (<$mounts>) {
my @m = split(" ");
if ($m[0] eq $dev) { return $m[2] }
diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL
index 2d00930..1549f03 100644
--- a/dist/XSLoader/XSLoader_pm.PL
+++ b/dist/XSLoader/XSLoader_pm.PL
@@ -4,14 +4,14 @@ use Config;
eval { require DynaLoader };

1 while unlink "XSLoader.pm";
-open OUT, ">XSLoader.pm" or die $!;
+open OUT, '>', 'XSLoader.pm' or die $!;
print OUT <<'EOT';
# Generated from XSLoader.pm.PL (resolved %Config::Config value)
# This file is unique for every OS

package XSLoader;

-$VERSION = "0.24";
+$VERSION = "0.26";

#use strict;

diff --git a/dist/lib/lib_pm.PL b/dist/lib/lib_pm.PL
index 8706e82..a4c5cc3 100644
--- a/dist/lib/lib_pm.PL
+++ b/dist/lib/lib_pm.PL
@@ -61,7 +61,7 @@ if ($expand_config_vars) {
q(reverse split / /, $Config{inc_version_list});
}

-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";

@@ -86,7 +86,7 @@ my \@inc_version_list = $Config_inc_version_list;
print OUT <<'!NO!SUBS!';

our @ORIG_INC = @INC; # take a handy copy of 'original' value
-our $VERSION = '0.63';
+our $VERSION = '0.64';

sub import {
shift;
diff --git a/dist/lib/t/01lib.t b/dist/lib/t/01lib.t
index 7cf644d..a1b023d 100644
--- a/dist/lib/t/01lib.t
+++ b/dist/lib/t/01lib.t
@@ -27,7 +27,7 @@ BEGIN {

mkpath [$Auto_Dir];

- open(MOD, ">$Module") || DIE $!;
+ open(MOD, '>', $Module) || DIE $!;
print MOD <<'MODULE';
package Yup;
$Plan = 9;
diff --git a/djgpp/fixpmain b/djgpp/fixpmain
index 8ebbf78..9ff2ad6 100644
--- a/djgpp/fixpmain
+++ b/djgpp/fixpmain
@@ -5,8 +5,8 @@

use Config;

-open (PERLM,"-open (MAKEFILE,"+open (PERLM, '<', 'perlmain.c') or die "Can't load perlmain.c: $!";
+open (MAKEFILE, '<', 'makefile.pl') or die "Can't load makefile.pl: $!";
undef $/;
$perlmain=;
$makefile=;
@@ -29,5 +29,5 @@ for $realname (@exts)
#DynaLoader is special
$perlmain =~ s/(DynaLoader:\:boot)strap/$1_DynaLoader/gm;

-open (PERLM,">perlmain.c") or die "Can't write perlmain.c: $!";
+open (PERLM, '>', 'perlmain.c') or die "Can't write perlmain.c: $!";
print PERLM $perlmain;
diff --git a/ext/B/B/Xref.pm b/ext/B/B/Xref.pm
index 8beb243..255ee89 100644
--- a/ext/B/B/Xref.pm
+++ b/ext/B/B/Xref.pm
@@ -1,6 +1,6 @@
package B::Xref;

-our $VERSION = '1.05';
+our $VERSION = '1.06';

=head1 NAME

@@ -449,7 +449,7 @@ sub compile {
last OPTION;
} elsif ($opt eq "o") {
$arg ||= shift @options;
- open(STDOUT, ">$arg") or return "$arg: $!\n";
+ open(STDOUT, '>', $arg) or return "$arg: $!\n";
} elsif ($opt eq "d") {
$nodefs = 1;
} elsif ($opt eq "r") {
diff --git a/ext/B/t/OptreeCheck.pm b/ext/B/t/OptreeCheck.pm
index 3ae1930..e7af99e 100644
--- a/ext/B/t/OptreeCheck.pm
+++ b/ext/B/t/OptreeCheck.pm
@@ -5,7 +5,7 @@ use warnings;
use vars qw($TODO $Level $using_open);
require "test.pl";

-our $VERSION = '0.14';
+our $VERSION = '0.15';

# now export checkOptree, and those test.pl functions used by tests
our @EXPORT = qw( checkOptree plan skip skip_all pass is like unlike
@@ -1001,7 +1001,7 @@ sub OptreeCheck::processExamples {
# turned into optreeCheck tests,

foreach my $file (@files) {
- open (my $fh, $file) or die "cant open $file: $!\n";
+ open (my $fh, '<', $file) or die "cant open $file: $!\n";
$/ = "";
my @chunks = <$fh>;
print preamble (scalar @chunks);
diff --git a/ext/B/t/xref.t b/ext/B/t/xref.t
index 32a80e7..3e201c1 100644
--- a/ext/B/t/xref.t
+++ b/ext/B/t/xref.t
@@ -32,7 +32,7 @@ open STDOUT, ">&SAVEOUT" or diag $!;
# line 200
my ($curfile, $cursub, $curpack) = ('') x 3;
our %xreftable = ();
-open XREF, $file or die "# Can't open $file: $!\n";
+open XREF, '<', $file or die "# Can't open $file: $!\n";
while () {
print STDERR $_ if $ENV{PERL_DEBUG};
chomp;
diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t
index 07f6510..d62e3b2 100644
--- a/ext/Devel-Peek/t/Peek.t
+++ b/ext/Devel-Peek/t/Peek.t
@@ -37,7 +37,7 @@ sub do_test {
my $repeat_todo = $_[4];
my $pattern = $_[2];
my $do_eval = $_[5];
- if (open(OUT,">peek$$")) {
+ if (open(OUT,'>', "peek$$")) {
open(STDERR, ">&OUT") or die "Can't dup OUT: $!";
if ($do_eval) {
my $sub = eval "sub { Dump $_[1] }";
@@ -56,7 +56,7 @@ sub do_test {
}
open(STDERR, ">&SAVERR") or die "Can't restore STDERR: $!";
close(OUT);
- if (open(IN, "peek$$")) {
+ if (open(IN, '<', "peek$$")) {
local $/;
$pattern =~ s/\$ADDR/0x[[:xdigit:]]+/g;
$pattern =~ s/\$FLOAT/(?:\\d*\\.\\d+(?:e[-+]\\d+)?|\\d+)/g;
@@ -1146,7 +1146,7 @@ unless ($Config{useithreads}) {
# (One block of study tests removed when study was made a no-op.)

{
- open(OUT,">peek$$") or die "Failed to open peek $$: $!";
+ open(OUT, '>', "peek$$") or die "Failed to open peek $$: $!";
open(STDERR, ">&OUT") or die "Can't dup OUT: $!";
DeadCode();
open(STDERR, ">&SAVERR") or die "Can't restore STDERR: $!";
@@ -1232,12 +1232,12 @@ do_test('UTF-8 in a regular expression',
use utf8;

sub _dump {
- open(OUT,">peek$$") or die $!;
+ open(OUT, '>', "peek$$") or die $!;
open(STDERR, ">&OUT") or die "Can't dup OUT: $!";
Dump($_[0]);
open(STDERR, ">&SAVERR") or die "Can't restore STDERR: $!";
close(OUT);
- open(IN, "peek$$") or die $!;
+ open(IN, '<', "peek$$") or die $!;
my $dump = do { local $/; };
close(IN);
1 while unlink "peek$$";
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index ee348c8..24c8bea 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -65,7 +65,7 @@ sub expand_os_specific {
}

unlink "DynaLoader.pm" if -f "DynaLoader.pm";
-open OUT, ">DynaLoader.pm" or die $!;
+open OUT, '>', "DynaLoader.pm" or die $!;
print OUT <<'EOT';

# Generated from DynaLoader_pm.PL, this file is unique for every OS
@@ -85,7 +85,7 @@ package DynaLoader;
# Tim.Bunce@ig.co.uk, August 1994

BEGIN {
- $VERSION = '1.40';
+ $VERSION = '1.41';
}

EOT
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index 8b1286d..d345e98 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
use Config;
use strict;

-our $VERSION = "1.27";
+our $VERSION = "1.28";

my %err = ();

@@ -13,7 +13,7 @@ my $IsMSWin32 = $^O eq 'MSWin32' && !$IsSymbian;

unlink "Errno.pm" if -f "Errno.pm";
unlink "Errno.tmp" if -f "Errno.tmp";
-open OUT, ">Errno.tmp" or die "Cannot open Errno.tmp: $!";
+open OUT, '>', 'Errno.tmp' or die "Cannot open Errno.tmp: $!";
select OUT;
my $file;
my @files = get_files();
@@ -21,7 +21,7 @@ if ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
# MinGW complains "warning: #pragma system_header ignored outside include
# file" if the header files are processed individually, so include them
# all in .c file and process that instead.
- open INCS, '>includes.c' or
+ open INCS, '>', 'includes.c' or
die "Cannot open includes.c";
foreach $file (@files) {
next if $file eq 'errno.c';
@@ -68,7 +68,7 @@ sub process_file {
return;
}
} else {
- unless(open(FH,"< $file")) {
+ unless(open(FH, '<', $file)) {
# This file could be a temporary file created by cppstdin
# so only warn under -w, and return
warn "Cannot open '$file'" if $^W;
@@ -149,7 +149,7 @@ sub get_files {
$SDK =~ s!\\!/!g;
$file{"$SDK/epoc32/include/libc/sys/errno.h"} = 1;
} else {
- open(CPPI,"> errno.c") or
+ open(CPPI, '>', 'errno.c') or
die "Cannot open errno.c";

if ($^O eq 'NetWare') {
@@ -200,7 +200,7 @@ sub write_errno_pm {

# create the CPP input

- open(CPPI,"> errno.c") or
+ open(CPPI, '>', 'errno.c') or
die "Cannot open errno.c";

if ($^O eq 'NetWare') {
diff --git a/ext/Fcntl/t/syslfs.t b/ext/Fcntl/t/syslfs.t
index 09dea10..00e072b 100644
--- a/ext/Fcntl/t/syslfs.t
+++ b/ext/Fcntl/t/syslfs.t
@@ -234,7 +234,7 @@ explain() unless Test::Builder->new()->is_passing();
END {
# unlink may fail if applied directly to a large file
# be paranoid about leaving 5 gig files lying around
- open(BIG, ">$big0"); # truncate
+ open(BIG, '>', $big0); # truncate
close(BIG);
}

diff --git a/ext/File-Glob/t/basic.t b/ext/File-Glob/t/basic.t
index 2e6a474..1e264a2 100644
--- a/ext/File-Glob/t/basic.t
+++ b/ext/File-Glob/t/basic.t
@@ -192,7 +192,7 @@ if ($^O eq 'VMS') { # VMS is happily caseignorant
}

for (@f_names) {
- open T, "> $_";
+ open T, '>', $_;
close T;
}

diff --git a/ext/FileCache/t/02maxopen.t b/ext/FileCache/t/02maxopen.t
index c95ba73..00dbb1b 100644
--- a/ext/FileCache/t/02maxopen.t
+++ b/ext/FileCache/t/02maxopen.t
@@ -19,7 +19,7 @@ use Test::More tests => 5;
next unless fileno($path);
print $path "$path 2\n";
close($path);
- open($path, $path);
+ open($path, '<', $path);
<$path>;
push @cat, <$path>;
close($path);
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index b7045ba..0e426d4 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -18,7 +18,7 @@ BEGIN {

unlink ;

-open my $fh, $^X or die "Can't open $^X: $!";
+open my $fh, '<', $^X or die "Can't open $^X: $!";
my $fileno = fileno $fh;
isnt($fileno, undef, "Can find next available file descriptor");
close $fh or die $!;
diff --git a/ext/IPC-Open3/t/IPC-Open3.t b/ext/IPC-Open3/t/IPC-Open3.t
index 25cfdfb..aa196e5 100644
--- a/ext/IPC-Open3/t/IPC-Open3.t
+++ b/ext/IPC-Open3/t/IPC-Open3.t
@@ -210,7 +210,7 @@ foreach my $handle (qw (DUMMY STDIN STDOUT STDERR)) {
my $out = IO::Handle->new();
my $pid = eval {
local $SIG{__WARN__} = sub {
- open my $fh, '>/dev/tty';
+ open my $fh, '>', '/dev/tty';
return if "@_" =~ m!^Use of uninitialized value \$fd.*IO/Handle\.pm!;
print $fh "@_";
die @_
diff --git a/ext/IPC-Open3/t

1ae6ead Switch most open() calls to three-argument form.
Cross/generate_config_sh | 2 +-
NetWare/config_h.PL | 4 +--
NetWare/config_sh.PL | 4 +--
NetWare/t/NWModify.pl | 2 +-
NetWare/t/NWScripts.pl | 8 +++---
Porting/Maintainers.pm | 4 +--
Porting/add-package.pl | 4 +--
Porting/check83.pl | 2 +-
Porting/checkAUTHORS.pl | 3 ++-
Porting/checkVERSION.pl | 2 +-
Porting/checkansi.pl | 2 +-
Porting/checkcfguse.pl | 6 ++---
Porting/config_h.pl | 4 +--
Porting/corecpan.pl | 2 +-
Porting/leakfinder.pl | 6 ++---
Porting/makerel | 2 +-
Porting/manicheck | 2 +-
Porting/sync-with-cpan | 2 +-
autodoc.pl | 2 +-
charclass_invlists.h | 4 +--
configpm | 10 +++----
dist/Devel-SelfStubber/lib/Devel/SelfStubber.pm | 4 +--
dist/Devel-SelfStubber/t/Devel-SelfStubber.t | 22 +++++++--------
dist/Dumpvalue/t/Dumpvalue.t | 2 +-
dist/ExtUtils-CBuilder/t/01-basic.t | 2 +-
dist/ExtUtils-CBuilder/t/02-link.t | 2 +-
dist/ExtUtils-CBuilder/t/03-cplusplus.t | 2 +-
dist/I18N-LangTags/lib/I18N/LangTags.pm | 6 ++---
dist/IO/Makefile.PL | 2 +-
dist/IO/t/IO.t | 2 +-
dist/IO/t/io_dir.t | 2 +-
dist/IO/t/io_file.t | 2 +-
dist/IO/t/io_linenum.t | 2 +-
dist/IO/t/io_sock.t | 2 +-
dist/IO/t/io_unix.t | 2 +-
dist/Safe/t/safe2.t | 2 +-
dist/Search-Dict/t/Dict.t | 2 +-
dist/Storable/Storable.pm | 10 +++----
dist/Storable/t/code.t | 4 +--
dist/Storable/t/compat01.t | 2 +-
dist/Storable/t/destroy.t | 2 +-
dist/Storable/t/file_magic.t | 2 +-
dist/Storable/t/forgive.t | 2 +-
dist/Storable/t/testlib.pl | 6 ++---
dist/Term-ReadLine/lib/Term/ReadLine.pm | 7 +++--
dist/Test/lib/Test.pm | 8 +++---
dist/Test/t/mix.t | 4 +--
dist/Test/t/onfail.t | 2 +-
dist/Test/t/todo.t | 4 +--
dist/Tie-File/t/01_gen.t | 2 +-
dist/Tie-File/t/02_fetchsize.t | 2 +-
dist/Tie-File/t/03_longfetch.t | 2 +-
dist/Tie-File/t/04_splice.t | 2 +-
dist/Tie-File/t/05_size.t | 4 +--
dist/Tie-File/t/07_rv_splice.t | 2 +-
dist/Tie-File/t/08_ro.t | 4 +--
dist/Tie-File/t/09_gen_rs.t | 2 +-
dist/Tie-File/t/10_splice_rs.t | 2 +-
dist/Tie-File/t/11_rv_splice_rs.t | 2 +-
dist/Tie-File/t/12_longfetch_rs.t | 2 +-
dist/Tie-File/t/13_size_rs.t | 4 +--
dist/Tie-File/t/14_lock.t | 2 +-
dist/Tie-File/t/16_handle.t | 2 +-
dist/Tie-File/t/19_cache.t | 4 +--
dist/Tie-File/t/20_cache_full.t | 4 +--
dist/Tie-File/t/21_win32.t | 2 +-
dist/Tie-File/t/22_autochomp.t | 2 +-
dist/Tie-File/t/23_rv_ac_splice.t | 2 +-
dist/Tie-File/t/24_cache_loop.t | 2 +-
dist/Tie-File/t/25_gen_nocache.t | 2 +-
dist/Tie-File/t/26_twrite.t | 8 +++---
dist/Tie-File/t/27_iwrite.t | 4 +--
dist/Tie-File/t/28_mtwrite.t | 4 +--
dist/Tie-File/t/29_downcopy.t | 6 ++---
dist/Tie-File/t/29a_upcopy.t | 6 ++---
dist/Tie-File/t/30_defer.t | 6 ++---
dist/Tie-File/t/31_autodefer.t | 2 +-
dist/Tie-File/t/32_defer_misc.t | 2 +-
dist/Tie-File/t/33_defer_vs.t | 2 +-
dist/Time-HiRes/Makefile.PL | 12 ++++-----
dist/Time-HiRes/t/alarm.t | 2 +-
dist/Time-HiRes/t/sleep.t | 2 +-
dist/Time-HiRes/t/stat.t | 6 ++---
dist/Time-HiRes/t/utime.t | 4 +--
dist/XSLoader/XSLoader_pm.PL | 4 +--
dist/lib/lib_pm.PL | 4 +--
dist/lib/t/01lib.t | 2 +-
djgpp/fixpmain | 6 ++---
ext/B/B/Xref.pm | 4 +--
ext/B/t/OptreeCheck.pm | 4 +--
ext/B/t/xref.t | 2 +-
ext/Devel-Peek/t/Peek.t | 10 +++----
ext/DynaLoader/DynaLoader_pm.PL | 4 +--
ext/Errno/Errno_pm.PL | 12 ++++-----
ext/Fcntl/t/syslfs.t | 2 +-
ext/File-Glob/t/basic.t | 2 +-
ext/FileCache/t/02maxopen.t | 2 +-
ext/GDBM_File/t/fatal.t | 2 +-
ext/IPC-Open3/t/IPC-Open3.t | 2 +-
ext/IPC-Open3/t/fd.t | 2 +-
ext/POSIX/t/sysconf.t | 2 +-
ext/PerlIO-encoding/t/encoding.t | 10 +++----
ext/PerlIO-encoding/t/fallback.t | 6 ++---
ext/PerlIO-via/t/via.t | 4 +--
ext/Pod-Html/t/pod2html-lib.pl | 4 +--
ext/VMS-DCLsym/DCLsym.pm | 4 +--
ext/XS-APItest/Makefile.PL | 2 +-
ext/XS-APItest/t/printf.t | 2 +-
ext/XS-Typemap/t/Typemap.t | 2 +-
h2pl/mksizes | 2 +-
h2pl/mkvars | 2 +-
installhtml | 12 ++++-----
lib/DBM_Filter/t/01error.t | 2 +-
lib/DBM_Filter/t/02core.t | 2 +-
lib/English.t | 6 ++---
lib/ExtUtils/Embed.pm | 4 +--
lib/File/Compare.t | 2 +-
lib/File/Copy.t | 36 ++++++++++++-------------
lib/File/stat.t | 2 +-
lib/SelectSaver.t | 4 +--
lib/Symbol.pm | 4 +--
lib/Tie/Handle/stdhandle.t | 2 +-
lib/Unicode/UCD.pm | 4 +--
lib/diagnostics.pm | 6 ++---
lib/h2ph.t | 2 +-
lib/h2xs.t | 4 +--
lib/perl5db.pl | 18 ++++++-------
lib/utf8.t | 2 +-
lib/vmsish.t | 6 ++---
make_ext.pl | 2 +-
makedef.pl | 2 +-
os2/OS2/OS2-Process/Process.pm | 6 ++---
patchlevel.h | 4 +--
plan9/genconfig.pl | 10 +++----
pod/splitman | 2 +-
pod/splitpod | 2 +-
regcharclass.h | 4 +--
regen/embed.pl | 2 +-
regen/embed_lib.pl | 4 +--
regen/feature.pl | 2 +-
regen/mk_invlists.pl | 2 +-
regen/opcode.pl | 2 +-
regen/reentr.pl | 2 +-
regen/regcharclass.pl | 2 +-
regen/regcomp.pl | 2 +-
regen/regen_lib.pl | 6 ++---
symbian/config.pl | 24 ++++++++---------
symbian/demo_pl | 2 +-
symbian/hexdump.pl | 2 +-
symbian/makesis.pl | 6 ++---
symbian/sisify.pl | 12 ++++-----
symbian/version.pl | 2 +-
symbian/xsbuild.pl | 28 +++++++++----------
t/loc_tools.pl | 2 +-
t/test.pl | 2 +-
utils/c2ph.PL | 4 +--
utils/corelist.PL | 4 +--
utils/cpan.PL | 4 +--
utils/enc2xs.PL | 4 +--
utils/encguess.PL | 4 +--
utils/h2ph.PL | 12 ++++-----
utils/h2xs.PL | 22 +++++++--------
utils/instmodsh.PL | 4 +--
utils/json_pp.PL | 4 +--
utils/libnetcfg.PL | 2 +-
utils/perlbug.PL | 2 +-
utils/perldoc.PL | 2 +-
utils/perlivp.PL | 2 +-
utils/piconv.PL | 4 +--
utils/pl2pm.PL | 4 +--
utils/pod2html.PL | 2 +-
utils/prove.PL | 4 +--
utils/ptar.PL | 4 +--
utils/ptardiff.PL | 4 +--
utils/ptargrep.PL | 4 +--
utils/shasum.PL | 4 +--
utils/splain.PL | 6 ++---
utils/xsubpp.PL | 4 +--
utils/zipdetails.PL | 4 +--
vms/gen_shrfls.pl | 4 +--
vms/mms2make.pl | 4 +--
win32/bin/exetype.pl | 2 +-
win32/bin/pl2bat.pl | 4 +--
win32/bin/search.pl | 6 ++---
win32/ce-helpers/makedist.pl | 6 ++---
win32/config_h.PL | 4 +--
win32/config_sh.PL | 4 +--
187 files changed, 406 insertions(+), 406 deletions(-)

Upstream: perl5.git.perl.org


  • Share