diff options
187 files changed, 406 insertions, 406 deletions
diff --git a/Cross/generate_config_sh b/Cross/generate_config_sh index e47042a25f..203885e981 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 = <FILE>) { diff --git a/NetWare/config_h.PL b/NetWare/config_h.PL index d0eb05a30f..67d5bc3f0b 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 (<SH>) { 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 (<SH>) { diff --git a/NetWare/config_sh.PL b/NetWare/config_sh.PL index 0e1d351c1a..d2daf0ecc1 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 = <OPTF>); 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 (<PL>) { if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) { $opt{$1} = $2; diff --git a/NetWare/t/NWModify.pl b/NetWare/t/NWModify.pl index 4e9817448d..fa58b47e82 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 = <FH>; # 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 c16a4a13cd..5f21244fd9 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 ef56abb912..1c52829f32 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 ee03c45b68..012aa77894 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 64eac95b89..fbe5655589 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 (<MANIFEST>) { chomp; s/\s.+//; diff --git a/Porting/checkAUTHORS.pl b/Porting/checkAUTHORS.pl index 4204304536..56fb39eb68 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 (<FH>) { 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 9ad2ff54d8..d63c34ec2e 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 (<FH>) { diff --git a/Porting/checkansi.pl b/Porting/checkansi.pl index c072b28e2c..f16691aa3a 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 af3dd12cb1..986d4f9041 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 82f40d9fa0..8ac15824a2 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 <<EOW; #!/bin/sh # diff --git a/Porting/corecpan.pl b/Porting/corecpan.pl index 3a38d112c6..75b18abc77 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 c22a58e4cf..370ae5c6d9 100644 --- a/Porting/leakfinder.pl +++ b/Porting/leakfinder.pl @@ -31,9 +31,9 @@ for(`find .`) { =~ s/\0/'."\\0".'/grid; $prog = <<end; open oUt, ">&", STDOUT; - open STDOUT, ">/dev/null"; - open STDIN, "</dev/null"; - 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 0bf79908a3..53ecdc2cda 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,"<patchlevel.h" or die; +open PATCHLEVEL, '<', 'patchlevel.h' or die; my @patchlevel_h = <PATCHLEVEL>; close PATCHLEVEL; my $patchlevel_h = join "", grep { /^#\s*define/ } @patchlevel_h; diff --git a/Porting/manicheck b/Porting/manicheck index 1b506d928f..b544a12252 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 d0cc1d62be..6484c179c9 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 597607cc98..2e6a1c3f63 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 3f1411982c..9838bed70c 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: */ @@ -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 (<CONFIG_SH>) { 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,"<myconfig.SH") || die "open myconfig.SH failed: $!"; +open(MYCONFIG,'<','myconfig.SH') || die "open myconfig.SH failed: $!"; 1 while defined($_ = <MYCONFIG>) && !/^Summary of/; do { $heavy_txt .= $_ } until !defined($_ = <MYCONFIG>) || /^\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 e47cd3a332..781dd9f3e9 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 4d69090474..48e27cd073 100644 --- a/dist/Devel-SelfStubber/t/Devel-SelfStubber.t +++ b/dist/Devel-SelfStubber/t/Devel-SelfStubber.t @@ -30,7 +30,7 @@ while (<DATA>) { 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 = <FH>; 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 = <FH>; 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 = <FH>; 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 = <FH>; 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 $!; $_ = <FH>; close FH or die $!; diff --git a/dist/Dumpvalue/t/Dumpvalue.t b/dist/Dumpvalue/t/Dumpvalue.t index 8e9da19823..64cf52ee0d 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 b99382f2ba..3db8581db6 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 0c64619d54..6160c267d0 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 78290d349d..0c05ae29bb 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 2193208d62..c4d9ceab3d 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, "<in.dat"); + die unless open(IN, "<", "in.dat"); while(<IN>) { chomp; next unless /^([^=]+)=(.+)/s; @@ -502,7 +502,7 @@ program with: use I18N::LangTags qw(encode_language_tag); my %greetings; - die unless open(IN, "<in.dat"); + die unless open(IN, "<", "in.dat"); while(<IN>) { chomp; next unless /^([^=]+)=(.+)/s; diff --git a/dist/IO/Makefile.PL b/dist/IO/Makefile.PL index 7783cf995d..383eccb2a4 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 2551b2468d..247940f8e4 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 5472daa9b9..dc8eb43983 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 1cf60f5441..a3d79c908c 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 2d44f50940..734854b928 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 $!; <F> for (1 .. 10); diff --git a/dist/IO/t/io_sock.t b/dist/IO/t/io_sock.t index c9c443beb8..630b856625 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 = <SRC>; diff --git a/dist/IO/t/io_unix.t b/dist/IO/t/io_unix.t index 61ba3635f8..a6cd05c898 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 fc519ff559..b3f2dac21c 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 bc997b05d2..21b226e09c 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 7101641988..246957f490 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 7fc40ba5a7..d31e2315ea 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 2827676421..56d7df65f4 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 e9464fb40d..dcc3600f1d 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, "<foo" or die $!; + 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 5dc032dc33..a68665ddaf 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 c99421149c..af7aa1df56 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 6d885d7f68..9b07dd45f9 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 = <FH>; 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 db08947972..88d5a75877 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 84db5f3ff4..ce544ffe19 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} = [<SOURCEFILE>]; 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 (<DIFF>) { print $TESTERR "# $prefix $_"; diff --git a/dist/Test/t/mix.t b/dist/Test/t/mix.t index 5298338318..12607d73bf 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 '', <F>; close F; unlink "mix"; diff --git a/dist/Test/t/onfail.t b/dist/Test/t/onfail.t index 85fe9eb884..dd6b83ec15 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 74f9aefb8b..8d3d7948c1 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 '', <F>; close F; unlink "todo"; diff --git a/dist/Tie-File/t/01_gen.t b/dist/Tie-File/t/01_gen.t index 202b09c76a..e9504d3a1d 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 = <FH> } $a = "" unless defined $a; diff --git a/dist/Tie-File/t/02_fetchsize.t b/dist/Tie-File/t/02_fetchsize.t index 12d2b51cba..146a91ad63 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 7d5a3886fe..63dad4fa3a 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 b3880b758c..8d23c5851b 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 44c69f910f..72774c8070 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 e5c09b1a48..141383a640 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 5fd8933bf8..a38e7faf52 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 e590210335..88d8250ba0 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 50b8b0a7ee..da981db0d2 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 ae1053802a..2fc9f2c716 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 6f1905d6af..4e5d57b199 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 a2a8d53bdd..b2e534c970 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 cab48125b0..c523458f51 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 f799496be1..21a3fce946 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 = <FH> } $a = "" unless defined $a; diff --git a/dist/Tie-File/t/19_cache.t b/dist/Tie-File/t/19_cache.t index 81c693263e..a8b6e69c98 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 8b3bf0b2e0..bd4d6a760f 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 d06854441b..0ccf669737 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 $/ ; <F> }; 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 dee07a8ec8..ebf3eaca4c 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 = <FH> } $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 be229574f9..104045a175 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 0bc66bee2b..42c002c19b 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 78e5506215..ce55d27d6a 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 = <FH> } $a = "" unless defined $a; diff --git a/dist/Tie-File/t/26_twrite.t b/dist/Tie-File/t/26_twrite.t index e2a925f4e0..d827f1c3f9 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 = <FH> } $a = "" unless defined $a; diff --git a/dist/Tie-File/t/27_iwrite.t b/dist/Tie-File/t/27_iwrite.t index db591a81ba..04ad436e47 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 50e306d3b6..31463693df 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 51c941c3d2..793116a7c0 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 = <FH> } $a = "" unless defined $a; diff --git a/dist/Tie-File/t/29a_upcopy.t b/dist/Tie-File/t/29a_upcopy.t index 1130615f37..9840af4281 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 = <FH> } $a = "" unless defined $a; diff --git a/dist/Tie-File/t/30_defer.t b/dist/Tie-File/t/30_defer.t index 063b3a7090..975cdfba5c 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 = <F> } close F; diff --git a/dist/Tie-File/t/31_autodefer.t b/dist/Tie-File/t/31_autodefer.t index ea929a4097..baf72c2957 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 e0e3f15bb8..f4ee110551 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 071af77a68..b68541c0bc 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 9060fa20f3..ccad6a3e6f 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 <IN> 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 f600f99256..4935410d36 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 = <XDEFINE> || ""); close(XDEFINE); } diff --git a/dist/Time-HiRes/t/sleep.t b/dist/Time-HiRes/t/sleep.t index c4d802be40..b84b4c6725 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 = <XDEFINE> || ""); close(XDEFINE); } diff --git a/dist/Time-HiRes/t/stat.t b/dist/Time-HiRes/t/stat.t index e7552b5e25..a59a342e20 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, '<', $$); <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 e64f99bfbe..f84bccfbfb 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 2d0093050f..1549f03879 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 8706e82e44..a4c5cc38a7 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 7cf644d428..a1b023d138 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 8ebbf78623..9ff2ad620c 100644 --- a/djgpp/fixpmain +++ b/djgpp/fixpmain @@ -5,8 +5,8 @@ use Config; -open (PERLM,"<perlmain.c") or die "Can't load perlmain.c: $!"; -open (MAKEFILE,"<makefile.pl") or die "Can't load makefile.pl: $!"; +open (PERLM, '<', 'perlmain.c') or die "Can't load perlmain.c: $!"; +open (MAKEFILE, '<', 'makefile.pl') or die "Can't load makefile.pl: $!"; undef $/; $perlmain=<PERLM>; $makefile=<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 8beb243f71..255ee890bd 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 3ae19304d7..e7af99ece1 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 32a80e73d5..3e201c12e1 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 (<XREF>) { print STDERR $_ if $ENV{PERL_DEBUG}; chomp; diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t index 07f651073b..d62e3b21a1 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 $/; <IN> }; close(IN); 1 while unlink "peek$$"; diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index ee348c80ea..24c8bea36c 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 8b1286dde6..d345e98042 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 09dea10453..00e072ba60 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 2e6a4748d4..1e264a2eb1 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 c95ba73bca..00dbb1bd54 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 b7045bad69..0e426d4dbc 100644 --- a/ext/GDBM_File/t/fatal.t +++ b/ext/GDBM_File/t/fatal.t @@ -18,7 +18,7 @@ BEGIN { unlink <Op_dbmx*>; -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 25cfdfb6ae..aa196e5cf2 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/fd.t b/ext/IPC-Open3/t/fd.t index 2a71b1387c..adb1f5cd65 100644 --- a/ext/IPC-Open3/t/fd.t +++ b/ext/IPC-Open3/t/fd.t @@ -36,7 +36,7 @@ plan 3; fresh_perl_like(<<"EOP", use IPC::Open3; -open FOO, '$file' or die \$!; +open FOO, '<', '$file' or die \$!; open3('<&' . fileno FOO, my \$out, undef, \$ENV{PERLEXE}, '-eprint scalar <STDIN>'); print <\$out>; EOP diff --git a/ext/POSIX/t/sysconf.t b/ext/POSIX/t/sysconf.t index f23e0d3b3b..29cf20f210 100644 --- a/ext/POSIX/t/sysconf.t +++ b/ext/POSIX/t/sysconf.t @@ -110,7 +110,7 @@ SKIP: { -c $TTY or skip("$TTY not a character file", $n); - open(TTY, $TTY) + open(TTY, '<', $TTY) or skip("failed to open $TTY: $!", $n); -t TTY or skip("TTY ($TTY) not a terminal file", $n); diff --git a/ext/PerlIO-encoding/t/encoding.t b/ext/PerlIO-encoding/t/encoding.t index cba14a8243..088f89ee20 100644 --- a/ext/PerlIO-encoding/t/encoding.t +++ b/ext/PerlIO-encoding/t/encoding.t @@ -25,7 +25,7 @@ my $fail2 = "fb$$"; my $russki = "koi8r$$"; my $threebyte = "3byte$$"; -if (open(GRK, ">$grk")) { +if (open(GRK, '>', $grk)) { binmode(GRK, ":bytes"); # alpha beta gamma in ISO 8859-7 print GRK "\xe1\xe2\xe3"; @@ -40,7 +40,7 @@ if (open(GRK, ">$grk")) { close($i); } -if (open(UTF, "<$utf")) { +if (open(UTF, '<', $utf)) { binmode(UTF, ":bytes"); # alpha beta gamma in UTF-8 Unicode (0x3b1 0x3b2 0x3b3) @@ -57,7 +57,7 @@ if (open(UTF, "<$utf")) { close($i); } -if (open(GRK, "<$grk")) { +if (open(GRK, '<', $grk)) { binmode(GRK, ":bytes"); is(scalar <GRK>, "\xe1\xe2\xe3"); close GRK; @@ -68,10 +68,10 @@ $SIG{__WARN__} = sub {$warn .= $_[0]}; is (open(FAIL, ">:encoding(NoneSuch)", $fail1), undef, 'Open should fail'); like($warn, qr/^Cannot find encoding "NoneSuch" at/); -is(open(RUSSKI, ">$russki"), 1); +is(open(RUSSKI, '>', $russki), 1); print RUSSKI "\x3c\x3f\x78"; close RUSSKI or die "Could not close: $!"; -open(RUSSKI, "$russki"); +open(RUSSKI, '<', $russki); binmode(RUSSKI, ":raw"); my $buf1; read(RUSSKI, $buf1, 1); diff --git a/ext/PerlIO-encoding/t/fallback.t b/ext/PerlIO-encoding/t/fallback.t index cf3fdc325e..3abdfd3f37 100644 --- a/ext/PerlIO-encoding/t/fallback.t +++ b/ext/PerlIO-encoding/t/fallback.t @@ -33,7 +33,7 @@ my $file = "fallback$$.txt"; like($message, qr/does not map to iso-8859-1/o, "FB_WARN message"); } -open($fh,$file) || die "File cannot be re-opened"; +open($fh,'<',$file) || die "File cannot be re-opened"; my $line = <$fh>; is($line,"\\x{20ac}0.02\n","perlqq escapes"); close($fh); @@ -45,14 +45,14 @@ my $str = "\x{20AC}"; print $fh $str,"0.02\n"; close($fh); -open($fh,$file) || die "File cannot be re-opened"; +open($fh,'<',$file) || die "File cannot be re-opened"; my $line = <$fh>; is($line,"€0.02\n","HTML escapes"); close($fh); { no utf8; - open($fh,">$file") || die "File cannot be re-opened"; + open($fh,'>',$file) || die "File cannot be re-opened"; binmode($fh); print $fh "\xA30.02\n"; close($fh); diff --git a/ext/PerlIO-via/t/via.t b/ext/PerlIO-via/t/via.t index 0619592606..6787e11cc4 100644 --- a/ext/PerlIO-via/t/via.t +++ b/ext/PerlIO-via/t/via.t @@ -44,7 +44,7 @@ is($a, $b, 'compare original data with filtered version'); use warnings 'layer'; # Find fd number we should be using - my $fd = open($fh,">$tmp") && fileno($fh); + my $fd = open($fh,'>',$tmp) && fileno($fh); print $fh "Hello\n"; close($fh); @@ -52,7 +52,7 @@ is($a, $b, 'compare original data with filtered version'); like( $warnings, qr/^Cannot find package 'Unknown::Module'/, 'warn about unknown package' ); # Now open normally again to see if we get right fileno - my $fd2 = open($fh,"<$tmp") && fileno($fh); + my $fd2 = open($fh,'<',$tmp) && fileno($fh); is($fd2,$fd,"Wrong fd number after failed open"); my $data = <$fh>; diff --git a/ext/Pod-Html/t/pod2html-lib.pl b/ext/Pod-Html/t/pod2html-lib.pl index 27e3e94b96..dfe309ab84 100644 --- a/ext/Pod-Html/t/pod2html-lib.pl +++ b/ext/Pod-Html/t/pod2html-lib.pl @@ -70,7 +70,7 @@ sub convert_n_test { } # result - open my $in, $outfile or die "cannot open $outfile: $!"; + open my $in, '<', $outfile or die "cannot open $outfile: $!"; $result = <$in>; close $in; } @@ -88,7 +88,7 @@ sub convert_n_test { open my $tmpfile, ">", $expectfile or die $!; print $tmpfile $expect; close $tmpfile; - open my $diff_fh, "$diff $diffopt $expectfile $outfile |" or die $!; + open my $diff_fh, "-|", "$diff $diffopt $expectfile $outfile" or die $!; print STDERR "# $_" while <$diff_fh>; close $diff_fh; unlink $expectfile; diff --git a/ext/VMS-DCLsym/DCLsym.pm b/ext/VMS-DCLsym/DCLsym.pm index b239e1572d..6990e2af5a 100644 --- a/ext/VMS-DCLsym/DCLsym.pm +++ b/ext/VMS-DCLsym/DCLsym.pm @@ -7,7 +7,7 @@ use strict; # Package globals @ISA = ( 'DynaLoader' ); -$VERSION = '1.07'; +$VERSION = '1.08'; my(%Locsyms) = ( ':ID' => 'LOCAL' ); my(%Gblsyms) = ( ':ID' => 'GLOBAL'); my $DoCache = 1; @@ -105,7 +105,7 @@ sub FIRSTKEY { if (!$DoCache || !$Cache_set) { # We should eventually replace this with a C routine which walks the # CLI symbol table directly. If I ever get 'hold of an I&DS manual . . . - open(P,'Show Symbol * |'); + open(P, '-|', 'Show Symbol *'); while (<P>) { ($name,$eqs,$val) = /^\s+(\S+) (=+) (.+)/ or carp "VMS::DCLsym: unparseable line $_"; diff --git a/ext/XS-APItest/Makefile.PL b/ext/XS-APItest/Makefile.PL index c06fac6f22..d46fa64dcf 100644 --- a/ext/XS-APItest/Makefile.PL +++ b/ext/XS-APItest/Makefile.PL @@ -31,7 +31,7 @@ my @names = (qw(HV_DELETE HV_DISABLE_UVAR_XKEY HV_FETCH_ISSTORE ), {name=>"G_WANT", default=>["IV", "G_ARRAY|G_VOID"]}); -open my $fh, '../../overload.h' or die "Can't open ../../overload.h: $!"; +open my $fh, '<', '../../overload.h' or die "Can't open ../../overload.h: $!"; while (<$fh>) { push @names, {name => $1, macro => 1} if /^\s+([A-Za-z_0-9]+_amg),/; } diff --git a/ext/XS-APItest/t/printf.t b/ext/XS-APItest/t/printf.t index 8f43ee2532..968fdc4627 100644 --- a/ext/XS-APItest/t/printf.t +++ b/ext/XS-APItest/t/printf.t @@ -34,7 +34,7 @@ print_flush(); # Now redirect STDOUT and read from the file ok open(STDOUT, ">&", $oldout), "restore STDOUT"; -ok open(my $foo, "<foo.out"), "open foo.out"; +ok open(my $foo, '<', 'foo.out'), "open foo.out"; #print "# Test output by reading from file\n"; # now test the output my @output = map { chomp; $_ } <$foo>; diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t index 46ab20fd11..3e56b573d6 100644 --- a/ext/XS-Typemap/t/Typemap.t +++ b/ext/XS-Typemap/t/Typemap.t @@ -381,7 +381,7 @@ if (defined $fh) { ok( $Config{useperlio} ? T_STDIO_close( $fh ) : close( $fh ) ); # open from perl, and check contents - open($fh, "< $testfile"); + open($fh, '<', $testfile); ok($fh); my $line = <$fh>; is($line,$lines[0]); diff --git a/h2pl/mksizes b/h2pl/mksizes index cb4b8ab86e..f28ba9e243 100644 --- a/h2pl/mksizes +++ b/h2pl/mksizes @@ -2,7 +2,7 @@ ($iam = $0) =~ s%.*/%%; $tmp = "$iam.$$"; -open (CODE,">$tmp.c") || die "$iam: cannot create $tmp.c: $!\n"; +open (CODE, '>', "$tmp.c") || die "$iam: cannot create $tmp.c: $!\n"; $mask = q/printf ("$sizeof{'%s'} = %d;\n"/; diff --git a/h2pl/mkvars b/h2pl/mkvars index ffb0f0b0b9..219c00537e 100644 --- a/h2pl/mkvars +++ b/h2pl/mkvars @@ -8,7 +8,7 @@ foreach $include (@ARGV) { printf STDERR "including %s\n", $include; do $include; warn "sourcing $include: $@\n" if ($@); - if (!open (INCLUDE,"$LIB/$include")) { + if (!open (INCLUDE,'<',"$LIB/$include")) { warn "can't open $LIB/$include: $!\n"; next; } diff --git a/installhtml b/installhtml index 06342a8425..0199709bb4 100644 --- a/installhtml +++ b/installhtml @@ -233,7 +233,7 @@ foreach my $dir (@splithead) { # read in everything until what would have been the first =head # directive, patching the index as we go. - open(H, "<$file.html") || + open(H, '<', "$file.html") || die "$0: error opening $file.html for input: $!\n"; $/ = ""; my @data = (); @@ -250,7 +250,7 @@ foreach my $dir (@splithead) { close(H); # now rewrite the file - open(H, ">$file.html") || + open(H, '>', "$file.html") || die "$0: error opening $file.html for output: $!\n"; print H "@data", "\n"; close(H); @@ -298,7 +298,7 @@ sub create_index { my @files = sort(grep(/\.html?$/, readdir(DIR))); closedir(DIR); - open(HTML, ">$html") || + open(HTML, '>', $html) || die "$0: error opening $html for output: $!\n"; # for each .html file in the directory, extract the index @@ -307,7 +307,7 @@ sub create_index { foreach my $file (@files) { my $filedata = do { - open(my $in, "<$dir/$file") || + open(my $in, '<', "$dir/$file") || die "$0: error opening $dir/$file for input: $!\n"; local $/ = undef; <$in>; @@ -406,7 +406,7 @@ sub splitpod { # read the file in paragraphs $/ = ""; - open(SPLITIN, "<$pod") || + open(SPLITIN, '<', $pod) || die "$0: error opening $pod for input: $!\n"; @filedata = <SPLITIN>; close(SPLITIN) || @@ -462,7 +462,7 @@ sub splitpod { # create the new .pod file print "\tcreating $poddir/$file\n" if $verbose; - open(SPLITOUT, ">$poddir/$file") || + open(SPLITOUT, '>', "$poddir/$file") || die "$0: error opening $poddir/$file for output: $!\n"; $poddata[$i] =~ s,L<([^<>]*)>, defined $heads{anchorify($1)} ? "L<$dir/$1>" : "L<$1>" diff --git a/lib/DBM_Filter/t/01error.t b/lib/DBM_Filter/t/01error.t index 1aff972b4e..33173f3e7e 100644 --- a/lib/DBM_Filter/t/01error.t +++ b/lib/DBM_Filter/t/01error.t @@ -24,7 +24,7 @@ sub writeFile { my $filename = shift ; my $content = shift; - open F, ">$filename" or croak "Cannot open $filename: $!" ; + open F, '>', $filename or croak "Cannot open $filename: $!" ; print F $content ; close F; } diff --git a/lib/DBM_Filter/t/02core.t b/lib/DBM_Filter/t/02core.t index a9538e52d1..1f5fef94f1 100644 --- a/lib/DBM_Filter/t/02core.t +++ b/lib/DBM_Filter/t/02core.t @@ -22,7 +22,7 @@ sub writeFile { my $filename = shift ; my $content = shift; - open F, ">DBM_Filter/$filename.pm" or croak "Cannot open $filename: $!" ; + open F, '>', "DBM_Filter/$filename.pm" or croak "Cannot open $filename: $!" ; print F $content ; close F; $files{"DBM_Filter/$filename.pm"} ++; diff --git a/lib/English.t b/lib/English.t index bed1162677..35a06caacf 100644 --- a/lib/English.t +++ b/lib/English.t @@ -36,7 +36,7 @@ $ORS = "\n"; if ($^O ne 'dos') { pipe(IN, OUT); } else { - open(OUT, ">en.tmp"); + open(OUT, ">", "en.tmp"); } select(OUT); $| = 1; @@ -48,7 +48,7 @@ $ORS = "\n"; my $close = close OUT; ok( !($close) == $CHILD_ERROR, '$CHILD_ERROR should be false' ); - open(IN, "<en.tmp") if ($^O eq 'dos'); + open(IN, "<", "en.tmp") if ($^O eq 'dos'); my $foo = <IN>; like( $foo, qr/ok 7/, '$OFS' ); @@ -129,7 +129,7 @@ is( $keys[1], 'd|e|f', '$SUBSCRIPT_SEPARATOR' ); eval { is( $EXCEPTIONS_BEING_CAUGHT, 1, '$EXCEPTIONS_BEING_CAUGHT' ) }; ok( !$EXCEPTIONS_BEING_CAUGHT, '$EXCEPTIONS_BEING_CAUGHT should be false' ); -eval { local *F; my $f = 'asdasdasd'; ++$f while -e $f; open(F, $f); }; +eval { local *F; my $f = 'asdasdasd'; ++$f while -e $f; open(F, '<', $f); }; is( $OS_ERROR, $ERRNO, '$OS_ERROR' ); ok( $OS_ERROR{ENOENT}, '%OS_ERROR (ENOENT should be set)' ); diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm index 9305b5dc13..b26bf7382e 100644 --- a/lib/ExtUtils/Embed.pm +++ b/lib/ExtUtils/Embed.pm @@ -10,7 +10,7 @@ use vars qw(@ISA @EXPORT $VERSION use strict; # This is not a dual-life module, so no need for development version numbers -$VERSION = '1.33'; +$VERSION = '1.34'; @ISA = qw(Exporter); @EXPORT = qw(&xsinit &ldopts @@ -199,7 +199,7 @@ sub ldopts { push @archives, $archive; if(-e ($extra = File::Spec->catdir($_,"auto",$root,"extralibs.ld"))) { local(*FH); - if(open(FH, $extra)) { + if(open(FH, '<', $extra)) { my($libs) = <FH>; chomp $libs; push @potential_libs, split /\s+/, $libs; } diff --git a/lib/File/Compare.t b/lib/File/Compare.t index c8c730d6fe..b7c9d9f7be 100644 --- a/lib/File/Compare.t +++ b/lib/File/Compare.t @@ -73,7 +73,7 @@ eval { { local $/; #slurp my $fh; - open($fh,$README); + open($fh,'<',$README); binmode($fh); my $data = <$fh>; print $tfh $data; diff --git a/lib/File/Copy.t b/lib/File/Copy.t index 9e49c7d3f0..05590b262f 100644 --- a/lib/File/Copy.t +++ b/lib/File/Copy.t @@ -43,14 +43,14 @@ for my $cross_partition_test (0..1) { } # First we create a file - open(F, ">file-$$") or die $!; + open(F, ">", "file-$$") or die $!; binmode F; # for DOSISH platforms, because test 3 copies to stdout printf F "ok\n"; close F; copy "file-$$", "copy-$$"; - open(F, "copy-$$") or die $!; + open(F, "<", "copy-$$") or die $!; my $foo = <F>; close(F); @@ -65,16 +65,16 @@ for my $cross_partition_test (0..1) { $TB->current_test($TB->current_test + 1); unlink "copy-$$" or die "unlink: $!"; - open(F,"file-$$"); + open(F, "<", "file-$$"); copy(*F, "copy-$$"); - open(R, "copy-$$") or die "open copy-$$: $!"; $foo = <R>; close(R); + open(R, "<", "copy-$$") or die "open copy-$$: $!"; $foo = <R>; close(R); is $foo, "ok\n", 'copy(*F, fn): same contents'; unlink "copy-$$" or die "unlink: $!"; - open(F,"file-$$"); + open(F, "<", "file-$$"); copy(\*F, "copy-$$"); close(F) or die "close: $!"; - open(R, "copy-$$") or die; $foo = <R>; close(R) or die "close: $!"; + open(R, "<", "copy-$$") or die; $foo = <R>; close(R) or die "close: $!"; is $foo, "ok\n", 'copy(\*F, fn): same contents'; unlink "copy-$$" or die "unlink: $!"; @@ -83,7 +83,7 @@ for my $cross_partition_test (0..1) { binmode $fh or die $!; copy("file-$$",$fh); $fh->close or die "close: $!"; - open(R, "copy-$$") or die; $foo = <R>; close(R); + open(R, "<", "copy-$$") or die; $foo = <R>; close(R); is $foo, "ok\n", 'copy(fn, io): same contents'; unlink "copy-$$" or die "unlink: $!"; @@ -92,7 +92,7 @@ for my $cross_partition_test (0..1) { binmode $fh or die $!; copy("file-$$",$fh); $fh->close; - open(R, "copy-$$") or die $!; $foo = <R>; close(R); + open(R, "<", "copy-$$") or die $!; $foo = <R>; close(R); is $foo, "ok\n", 'copy(fn, fh): same contents'; unlink "file-$$" or die "unlink: $!"; @@ -111,7 +111,7 @@ for my $cross_partition_test (0..1) { ok move("copy-$$", "file-$$"), 'move'; ok -e "file-$$", ' destination exists'; ok !-e "copy-$$", ' source does not'; - open(R, "file-$$") or die $!; $foo = <R>; close(R); + open(R, "<", "file-$$") or die $!; $foo = <R>; close(R); is $foo, "ok\n", 'contents preserved'; TODO: { @@ -126,13 +126,13 @@ for my $cross_partition_test (0..1) { # trick: create lib/ if not exists - not needed in Perl core unless (-d 'lib') { mkdir 'lib' or die $!; } copy "file-$$", "lib"; - open(R, "lib/file-$$") or die $!; $foo = <R>; close(R); + open(R, "<", "lib/file-$$") or die $!; $foo = <R>; close(R); is $foo, "ok\n", 'copy(fn, dir): same contents'; unlink "lib/file-$$" or die "unlink: $!"; # Do it twice to ensure copying over the same file works. copy "file-$$", "lib"; - open(R, "lib/file-$$") or die $!; $foo = <R>; close(R); + open(R, "<", "lib/file-$$") or die $!; $foo = <R>; close(R); is $foo, "ok\n", 'copy over the same file works'; unlink "lib/file-$$" or die "unlink: $!"; @@ -146,7 +146,7 @@ for my $cross_partition_test (0..1) { } move "file-$$", "lib"; - open(R, "lib/file-$$") or die "open lib/file-$$: $!"; $foo = <R>; close(R); + open(R, "<", "lib/file-$$") or die "open lib/file-$$: $!"; $foo = <R>; close(R); is $foo, "ok\n", 'move(fn, dir): same contents'; ok !-e "file-$$", 'file moved indeed'; unlink "lib/file-$$" or die "unlink: $!"; @@ -154,7 +154,7 @@ for my $cross_partition_test (0..1) { SKIP: { skip "Testing symlinks", 3 unless $Config{d_symlink}; - open(F, ">file-$$") or die $!; + open(F, ">", "file-$$") or die $!; print F "dummy content\n"; close F; symlink("file-$$", "symlink-$$") or die $!; @@ -175,7 +175,7 @@ for my $cross_partition_test (0..1) { skip "Testing hard links", 3 if !$Config{d_link} or $^O eq 'MSWin32' or $^O eq 'cygwin'; - open(F, ">file-$$") or die $!; + open(F, ">", "file-$$") or die $!; print F "dummy content\n"; close F; link("file-$$", "hardlink-$$") or die $!; @@ -192,13 +192,13 @@ for my $cross_partition_test (0..1) { unlink "file-$$" or die $!; } - open(F, ">file-$$") or die $!; + open(F, ">", "file-$$") or die $!; binmode F; print F "this is file\n"; close F; my $copy_msg = "this is copy\n"; - open(F, ">copy-$$") or die $!; + open(F, ">", "copy-$$") or die $!; binmode F; print F $copy_msg; close F; @@ -216,7 +216,7 @@ for my $cross_partition_test (0..1) { } is -s "copy-$$", length $copy_msg, "but does not truncate the destination"; - open(F, "copy-$$") or die $!; + open(F, "<", "copy-$$") or die $!; $foo = <F>; close(F); is $foo, $copy_msg, "nor change the destination's contents"; @@ -228,7 +228,7 @@ for my $cross_partition_test (0..1) { TODO: { local $TODO = 'spaces in filenames require DECC$EFS_CHARSET enabled' if $^O eq 'VMS'; - open(F, ">file-$$") or die $!; + open(F, ">", "file-$$") or die $!; close F; copy "file-$$", " copy-$$"; ok -e " copy-$$", "copy with leading whitespace"; diff --git a/lib/File/stat.t b/lib/File/stat.t index 7c9b9cc340..c403fc4498 100644 --- a/lib/File/stat.t +++ b/lib/File/stat.t @@ -144,7 +144,7 @@ for (split //, "tTB") { SKIP: { local *STAT; - skip("Could not open file: $!", 2) unless open(STAT, $file); + skip("Could not open file: $!", 2) unless open(STAT, '<', $file); isa_ok(File::stat::stat('STAT'), 'File::stat', '... should be able to find filehandle'); diff --git a/lib/SelectSaver.t b/lib/SelectSaver.t index 3b58d709ab..757f0cd6ec 100644 --- a/lib/SelectSaver.t +++ b/lib/SelectSaver.t @@ -9,7 +9,7 @@ print "1..3\n"; use SelectSaver; -open(FOO, ">foo-$$") || die; +open(FOO, ">", "foo-$$") || die; print "ok 1\n"; { @@ -18,7 +18,7 @@ print "ok 1\n"; } # Get data written to file -open(FOO, "foo-$$") || die; +open(FOO, "<", "foo-$$") || die; chomp($foo = <FOO>); close FOO; unlink "foo-$$"; diff --git a/lib/Symbol.pm b/lib/Symbol.pm index 1e408b59f7..0e8d67fffd 100644 --- a/lib/Symbol.pm +++ b/lib/Symbol.pm @@ -9,7 +9,7 @@ Symbol - manipulate Perl symbols and their names use Symbol; $sym = gensym; - open($sym, "filename"); + open($sym, '<', "filename"); $_ = <$sym>; # etc. @@ -85,7 +85,7 @@ require Exporter; @EXPORT = qw(gensym ungensym qualify qualify_to_ref); @EXPORT_OK = qw(delete_package geniosym); -$VERSION = '1.07'; +$VERSION = '1.08'; my $genpkg = "Symbol::"; my $genseq = 0; diff --git a/lib/Tie/Handle/stdhandle.t b/lib/Tie/Handle/stdhandle.t index 228004fce2..d2f04bcc5c 100644 --- a/lib/Tie/Handle/stdhandle.t +++ b/lib/Tie/Handle/stdhandle.t @@ -15,7 +15,7 @@ $f = 'tst'; unlink("afile") if -f "afile"; -ok(open($f,"+>afile"), "open +>afile"); +ok(open($f, "+>", "afile"), "open +>, afile"); ok(open($f, "+<", "afile"), "open +<, afile"); ok(binmode($f), "binmode") or diag("binmode: $!\n"); diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index 75b2b80666..4939677fcc 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -5,7 +5,7 @@ use warnings; no warnings 'surrogate'; # surrogates can be inputs to this use charnames (); -our $VERSION = '0.67'; +our $VERSION = '0.68'; require Exporter; @@ -154,7 +154,7 @@ sub openunicode { for my $d (@INC) { use File::Spec; $f = File::Spec->catfile($d, "unicore", @path); - last if open($$rfh, $f); + last if open($$rfh, '<', $f); undef $f; } croak __PACKAGE__, ": failed to find ", diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index 731b1a00a7..860a0aa846 100644 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -186,7 +186,7 @@ use 5.009001; use Carp; $Carp::Internal{__PACKAGE__.""}++; -our $VERSION = '1.35'; +our $VERSION = '1.36'; our $DEBUG; our $VERBOSE; our $PRETTY; @@ -231,7 +231,7 @@ CONFIG: { $PRETTY = $opt_p; } - if (open(POD_DIAG, $PODFILE)) { + if (open(POD_DIAG, '<', $PODFILE)) { warn "Happy happy podfile from real $PODFILE\n" if $DEBUG; last CONFIG; } @@ -240,7 +240,7 @@ CONFIG: { INCPATH: { for my $file ( (map { "$_/".__PACKAGE__.".pm" } @INC), $0) { warn "Checking $file\n" if $DEBUG; - if (open(POD_DIAG, $file)) { + if (open(POD_DIAG, '<', $file)) { while (<POD_DIAG>) { next unless /^__END__\s*# wish diag dbase were more accessible/; diff --git a/lib/h2ph.t b/lib/h2ph.t index bdcc389073..377cc63131 100644 --- a/lib/h2ph.t +++ b/lib/h2ph.t @@ -23,7 +23,7 @@ plan(6); sub txt_compare { local $/; my ($A, $B); - for (($A,$B) = @_) { open(_,"<$_") ? $_ = <_> : die "$_ : $!"; close _ } + for (($A,$B) = @_) { open(_,"<",$_) ? $_ = <_> : die "$_ : $!"; close _ } $A cmp $B; } diff --git a/lib/h2xs.t b/lib/h2xs.t index 25502dadd1..69746a52b3 100644 --- a/lib/h2xs.t +++ b/lib/h2xs.t @@ -167,7 +167,7 @@ for (my $i = $#tests; $i > 0; $i-=3) { plan tests => $total_tests; -ok (open (HEADER, ">$header"), "open '$header'"); +ok (open (HEADER, '>', $header), "open '$header'"); print HEADER <<HEADER or die $!; #define Camel 2 #define Dromedary 1 @@ -238,7 +238,7 @@ while (my ($args, $version, $expectation) = splice @tests, 0, 3) { foreach my $leaf (File::Spec->catfile('lib', "$name.pm"), 'Makefile.PL') { my $file = File::Spec->catfile($name, $leaf); - if (ok (open (FILE, $file), "open $file")) { + if (ok (open (FILE, '<', $file), "open $file")) { my $match = qr/use $version;/; my $found; while (<FILE>) { diff --git a/lib/perl5db.pl b/lib/perl5db.pl index 07ee636c58..4668a1fc05 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -529,7 +529,7 @@ BEGIN { use vars qw($VERSION $header); # bump to X.XX in blead, only use X.XX_XX in maint -$VERSION = '1.50'; +$VERSION = '1.51'; $header = "perl5db.pl version $VERSION"; @@ -1656,14 +1656,14 @@ and if we can. $o = $i unless defined $o; # read/write on in, or just read, or read on STDIN. - open( IN, "+<$i" ) - || open( IN, "<$i" ) + open( IN, '+<', $i ) + || open( IN, '<', $i ) || open( IN, "<&STDIN" ); # read/write/create/clobber out, or write/create/clobber out, # or merge with STDERR, or merge with STDOUT. - open( OUT, "+>$o" ) - || open( OUT, ">$o" ) + open( OUT, '+>', $o ) + || open( OUT, '>', $o ) || open( OUT, ">&STDERR" ) || open( OUT, ">&STDOUT" ); # so we don't dongle stdout @@ -6828,8 +6828,8 @@ sub setterm { if ($tty) { my ( $i, $o ) = split $tty, /,/; $o = $i unless defined $o; - open( IN, "<$i" ) or die "Cannot open TTY '$i' for read: $!"; - open( OUT, ">$o" ) or die "Cannot open TTY '$o' for write: $!"; + open( IN, '<', $i ) or die "Cannot open TTY '$i' for read: $!"; + open( OUT, '>', $o ) or die "Cannot open TTY '$o' for write: $!"; $IN = \*IN; $OUT = \*OUT; _autoflush($OUT); @@ -7752,8 +7752,8 @@ sub TTY { } # Open file onto the debugger's filehandles, if you can. - open IN, $in or die "cannot open '$in' for read: $!"; - open OUT, ">$out" or die "cannot open '$out' for write: $!"; + open IN, '<', $in or die "cannot open '$in' for read: $!"; + open OUT, '>', $out or die "cannot open '$out' for write: $!"; # Swap to the new filehandles. reset_IN_OUT( \*IN, \*OUT ); diff --git a/lib/utf8.t b/lib/utf8.t index 06d9a84af9..6b28eae948 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -170,7 +170,7 @@ BANG ); foreach (@tests) { my ($why, $prog, $expect) = @$_; - open P, ">$progfile" or die "Can't open '$progfile': $!"; + open P, ">", $progfile or die "Can't open '$progfile': $!"; binmode(P, ":bytes") if $has_perlio; print P $show, $prog, '; print $b' or die "Print to 'progfile' failed: $!"; diff --git a/lib/vmsish.t b/lib/vmsish.t index f2b451d918..7681f07f60 100644 --- a/lib/vmsish.t +++ b/lib/vmsish.t @@ -106,7 +106,7 @@ is($?,0,"outer lex scope of vmsish [POSIX status]"); ok(($msg !~ /ABORT/),"vmsish ERR exit, vmsish hushed at runtime, DCL error message check"); local *TEST; - open(TEST,'>vmsish_test.pl') || die('not ok ?? : unable to open "vmsish_test.pl" for writing'); + open(TEST,'>','vmsish_test.pl') || die('not ok ?? : unable to open "vmsish_test.pl" for writing'); print TEST "#! perl\n"; print TEST "use vmsish qw(hushed);\n"; print TEST "\$obvious = (\$compile(\$error;\n"; @@ -137,7 +137,7 @@ is($?,0,"outer lex scope of vmsish [POSIX status]"); # we create a file rather than using an existing one for the stat() test. my $file = 'sys$scratch:vmsish_t_flirble.tmp'; - open TMP, ">$file" or die "Couldn't open file $file"; + open TMP, '>', $file or die "Couldn't open file $file"; close TMP; END { 1 while unlink $file; } @@ -187,7 +187,7 @@ is($?,0,"outer lex scope of vmsish [POSIX status]"); # they were turned off in invoking procedure sub do_a_perl { local *P; - open(P,'>vmsish_test.com') || die('not ok ?? : unable to open "vmsish_test.com" for writing'); + open(P,'>','vmsish_test.com') || die('not ok ?? : unable to open "vmsish_test.com" for writing'); print P "\$ set message/facil/sever/ident/text\n"; print P "\$ define/nolog/user sys\$error _nla0:\n"; print P "\$ $Invoke_Perl @_\n"; diff --git a/make_ext.pl b/make_ext.pl index 8270092d7d..c129a34039 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -287,7 +287,7 @@ sub build_extension { if (-f $makefile) { $makefile_no_minus_f = 0; - open my $mfh, $makefile or die "Cannot open $makefile: $!"; + open my $mfh, '<', $makefile or die "Cannot open $makefile: $!"; while (<$mfh>) { # Plagiarised from CPAN::Distribution last if /MakeMaker post_initialize section/; diff --git a/makedef.pl b/makedef.pl index 68ae706217..8e29f2aed9 100644 --- a/makedef.pl +++ b/makedef.pl @@ -1227,7 +1227,7 @@ if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) { if ($ARGS{PLATFORM} eq 'os2') { my (%mapped, @missing); - open MAP, 'miniperl.map' or die 'Cannot read miniperl.map'; + open MAP, '<', 'miniperl.map' or die 'Cannot read miniperl.map'; /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>; close MAP or die 'Cannot close miniperl.map'; diff --git a/os2/OS2/OS2-Process/Process.pm b/os2/OS2/OS2-Process/Process.pm index 08b619f8e3..7c419036f2 100644 --- a/os2/OS2/OS2-Process/Process.pm +++ b/os2/OS2/OS2-Process/Process.pm @@ -20,7 +20,7 @@ BEGIN { #require AutoLoader; our @ISA = qw(Exporter); - our $VERSION = "1.11"; + our $VERSION = "1.12"; XSLoader::load('OS2::Process', $VERSION); } @@ -756,7 +756,7 @@ sub __term_mirror { close IN if defined $out; $pid > 0 or die "Cannot start a grandkid"; - open STDIN, '</dev/con' or warn "reopen stdin: $!"; + open STDIN, '<', '/dev/con' or warn "reopen stdin: $!"; select OUT; $| = 1; binmode OUT; # need binmode: sysread() may be bin $SIG{PIPE} = sub { die "writing to a closed pipe" }; $SIG{HUP} = $SIG{BREAK} = $SIG{INT} = $SIG{TERM}; @@ -1044,7 +1044,7 @@ gets a buffer with characters and attributes of the screen. restores the screen given the result of screen(). E.g., if the file C<$file> contains the screen contents, then - open IN, $file or die; + open IN, '<', $file or die; binmode IN; read IN, $in, -s IN; $s = screen; diff --git a/patchlevel.h b/patchlevel.h index d7c8d4820e..fbf74f9d53 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -90,8 +90,8 @@ #!perl die "Usage: perl -x patchlevel.h comment ..." unless @ARGV; -open PLIN, "patchlevel.h" or die "Couldn't open patchlevel.h : $!"; -open PLOUT, ">patchlevel.new" or die "Couldn't write on patchlevel.new : $!"; +open PLIN, "<", "patchlevel.h" or die "Couldn't open patchlevel.h : $!"; +open PLOUT, ">", "patchlevel.new" or die "Couldn't write on patchlevel.new : $!"; my $seen=0; while (<PLIN>) { if (/\t,NULL/ and $seen) { diff --git a/plan9/genconfig.pl b/plan9/genconfig.pl index 623423d7d4..ebd97db018 100644 --- a/plan9/genconfig.pl +++ b/plan9/genconfig.pl @@ -28,7 +28,7 @@ unshift(@INC,'lib'); # In case someone didn't define Perl_Root # before the build if ($ARGV[0] eq '-f') { - open(ARGS,$ARGV[1]) or die "Can't read data from $ARGV[1]: $!\n"; + open(ARGS,'<',$ARGV[1]) or die "Can't read data from $ARGV[1]: $!\n"; @ARGV = (); while (<ARGS>) { push(@ARGV,split(/\|/,$_)); @@ -47,8 +47,8 @@ Can't find config.h to read! EndOfGasp } $outdir = ''; -open(IN,"$infile") || die "Can't open $infile: $!\n"; -open(OUT,">${outdir}config.sh") || die "Can't open ${outdir}config.sh: $!\n"; +open(IN,'<',$infile) || die "Can't open $infile: $!\n"; +open(OUT,'>',"${outdir}config.sh") || die "Can't open ${outdir}config.sh: $!\n"; $time = localtime; $cf_by = $ENV{'user'}; @@ -174,7 +174,7 @@ print OUT "myuname='Plan9 $myname $osvers $p9p_objtype'\n"; # Before we read the C header file, find out what config.sh constants are # equivalent to the C preprocessor macros -if (open(SH,"${outdir}config_h.SH")) { +if (open(SH,'<',"${outdir}config_h.SH")) { while (<SH>) { next unless m%^#(?!if).*\$%; s/^#//; s!(.*?)\s*/\*.*!$1!; @@ -267,7 +267,7 @@ foreach (sort keys %val_vars) { # print OUT "libs='",join(' ',@libs),"'\n"; # print OUT "libc='",join(' ',@crtls),"'\n"; -if (open(PL,"${outdir}patchlevel.h")) { +if (open(PL,'<',"${outdir}patchlevel.h")) { while (<PL>) { if (/^#define PERL_VERSION\s+(\S+)/) { print OUT "PERL_VERSION='$1'\n"; diff --git a/pod/splitman b/pod/splitman index 9fe404a061..325e1d96ee 100644 --- a/pod/splitman +++ b/pod/splitman @@ -14,7 +14,7 @@ while (<>) { if (name($desc) ne $myname) { $myname = name($desc); print $myname, "\n"; - open(MAN, "> $myname.3pl"); + open(MAN, '>', "$myname.3pl"); print MAN <<EOALL; $header .TH $myname 3PL "\\*(RP" diff --git a/pod/splitpod b/pod/splitpod index 10fd6afb11..1bc91bd183 100644 --- a/pod/splitpod +++ b/pod/splitpod @@ -46,7 +46,7 @@ for $f ( keys %syn ) { my $has_back = $body =~ /^=back/; $body =~ s/^=over\s*//m if $has_over and !$has_back; $body =~ s/^=back\s*//m if $has_back and !$has_over; - open (POD, "> $name.pod") || die "can't open $name.pod: $!"; + open (POD, '>', "$name.pod") || die "can't open $name.pod: $!"; print POD <<EOF; \=head1 NAME diff --git a/regcharclass.h b/regcharclass.h index c26eb279dc..bb44e8224c 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -1854,7 +1854,7 @@ #endif /* H_REGCHARCLASS */ /* 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 @@ -1900,6 +1900,6 @@ * 066d6e75f95cf6794161c8ac0b1a40990277de90eefb913be2e675a7cba38d59 lib/unicore/mktables * cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl - * cd1fd94a77ea1ce1181f72c8333f9e5bd0cd790d6e8d1f460756a3f9f3f2762d regen/regcharclass.pl + * 1d27ae8b75d81a082b1fc594673e08540280f8169309a7b5047015c8091a2bfb regen/regcharclass.pl * 393f8d882713a3ba227351ad0f00ea4839fda74fcf77dcd1cdf31519925adba5 regen/regcharclass_multi_char_folds.pl * ex: set ro: */ 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); diff --git a/symbian/config.pl b/symbian/config.pl index e82c365d5a..2671df6d8f 100644 --- a/symbian/config.pl +++ b/symbian/config.pl @@ -67,7 +67,7 @@ sub create_mmp { my $mmp = "$target.mmp"; my $targetpath = $miniperl || $perl ? "TARGETPATH\t\\System\\Apps\\Perl" : ""; - if ( open( my $fh, ">$mmp" ) ) { + if ( open( my $fh, '>', $mmp ) ) { print "\t$mmp\n"; push @mmp, $mmp; push @unclean, $mmp; @@ -209,7 +209,7 @@ __EOF__ } sub create_bld_inf { - if ( open( BLD_INF, ">bld.inf" ) ) { + if ( open( BLD_INF, '>', 'bld.inf' ) ) { print "\tbld.inf\n"; push @unclean, "bld.inf"; print BLD_INF <<__EOF__; @@ -228,7 +228,7 @@ __EOF__ my %config; sub load_config_sh { - if ( open( CONFIG_SH, "symbian/config.sh" ) ) { + if ( open( CONFIG_SH, '<', 'symbian/config.sh' ) ) { while (<CONFIG_SH>) { if (/^(\w+)=['"]?(.*?)["']?$/) { my ( $var, $val ) = ( $1, $2 ); @@ -249,10 +249,10 @@ sub load_config_sh { sub create_config_h { load_config_sh(); - if ( open( CONFIG_H, ">config.h" ) ) { + if ( open( CONFIG_H, '>', 'config.h' ) ) { print "\tconfig.h\n"; push @unclean, "config.h"; - if ( open( CONFIG_H_SH, "config_h.SH" ) ) { + if ( open( CONFIG_H_SH, '<', 'config_h.SH' ) ) { while (<CONFIG_H_SH>) { last if /\#ifndef _config_h_/; } @@ -298,7 +298,7 @@ q[xsubpp ext\DynaLoader\dl_symbian.xs >ext\DynaLoader\DynaLoader.cpp] sub create_symbian_port_h { print "\tsymbian\\symbian_port.h\n"; - if ( open( SYMBIAN_PORT_H, ">symbian/symbian_port.h" ) ) { + if ( open( SYMBIAN_PORT_H, '>', 'symbian/symbian_port.h' ) ) { my ($sdkmajor, $sdkminor); if ($SDK_VARIANT eq 'S60') { $S60SDK =~ /^(\d+)\.(\d+)$/; @@ -351,7 +351,7 @@ q[perl -ne "print qq[ char *file = __FILE__;\n] if /dXSUB_SYS/;print unless / sub create_PerlApp_pkg { print "\tsymbian\\PerlApp.pkg\n"; - if ( open( PERLAPP_PKG, ">symbian\\PerlApp.pkg" ) ) { + if ( open( PERLAPP_PKG, '>', 'symbian\\PerlApp.pkg' ) ) { my $ProductId = defined $S60SDK ? qq[;Supports Series 60 v0.9\n(0x101F6F88), 0, 0, 0, {"Series60ProductID"}\n] : @@ -392,7 +392,7 @@ $mdl "$APPS\\PerlApp.rsc"-"!:\\system\\apps\\PerlApp\\PerlApp.rsc" $AIF __EOF__ - if ( open( DEMOS, "perl symbian\\demo_pl list |" ) ) { + if ( open( DEMOS, '-|', "perl symbian\\demo_pl list" ) ) { while (<DEMOS>) { chomp; if (defined $S90SDK) { @@ -447,7 +447,7 @@ create_symbian_port_h(); create_DynaLoader_cpp(); create_PerlApp_pkg(); -if ( open( PERLAPP_MMP, ">symbian/PerlApp.mmp" ) ) { +if ( open( PERLAPP_MMP, '>', 'symbian/PerlApp.mmp' ) ) { my @MACRO; my @LIB; push @MACRO, 'PERL_IMPLICIT_CONTEXT'; @@ -543,7 +543,7 @@ else { warn "$0: failed to create symbian\\PerlApp.mmp"; } -if ( open( MAKEFILE, ">Makefile" ) ) { +if ( open( MAKEFILE, '>', 'Makefile' ) ) { my $perl = "perl$VERSION"; my $windef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$perl\\$WIN\\$perl.def"; my $windef2 = "..\\BWINS\\${perl}u.def"; @@ -895,7 +895,7 @@ else { warn "$0: failed to create Makefile: $!\n"; } -if ( open( MAKEFILE, ">symbian/Makefile")) { +if ( open( MAKEFILE, '>', 'symbian/Makefile')) { my $wrap = defined $S60SDK && $S60SDK eq '1.2' && $WIN ne '${WIN}cw'; my $ABLD = $wrap ? 'perl b.pl': 'abld'; print "\tsymbian/Makefile\n"; @@ -951,7 +951,7 @@ distclean: clean __EOF__ close(MAKEFILE); if ($wrap) { - if ( open( B_PL, ">symbian/b.pl")) { + if ( open( B_PL, '>', 'symbian/b.pl')) { print B_PL <<'__EOF__'; # abld.pl wrapper. diff --git a/symbian/demo_pl b/symbian/demo_pl index fbba5f4bf9..9759347a97 100644 --- a/symbian/demo_pl +++ b/symbian/demo_pl @@ -33,7 +33,7 @@ while (<DATA>) { unlink $1 or warn "$0: $1: $!\n"; } elsif ($extract) { defined $fh && close($fh); - open($fh, ">$1") or die "$0: '$1': $!\n"; + open($fh, ">", $1) or die "$0: '$1': $!\n"; print "Extracting $1\n"; } elsif ($list) { print "$1\n"; diff --git a/symbian/hexdump.pl b/symbian/hexdump.pl index 37adff3577..d1741f80b9 100644 --- a/symbian/hexdump.pl +++ b/symbian/hexdump.pl @@ -22,7 +22,7 @@ for my $fn ($EXE, $RSC) { my $newfn = $new{$fn}; unlink($newfn); if (($read = sysread($fh, $buffer, $size)) == $size) { - if (open(my $newfh, ">$newfn")) { + if (open(my $newfh, '>', $newfn)) { binmode($newfh); print $newfh unpack("H*", $buffer); close($newfh); diff --git a/symbian/makesis.pl b/symbian/makesis.pl index 270f6b4434..58199cec77 100644 --- a/symbian/makesis.pl +++ b/symbian/makesis.pl @@ -72,7 +72,7 @@ for my $target (@target) { print "\tErrno.pm\n"; $copy{"ext\\Errno\\Errno.pm"} = "$lib\\Perl\\$R_V_SV\\Errno.pm"; - open( my $cfg, "symbian/install.cfg" ) + open( my $cfg, '<', "symbian/install.cfg" ) or die "$!: symbian/install.cfg: $!\n"; while (<$cfg>) { next unless /^lib\s+(.+)/; @@ -98,7 +98,7 @@ for my $target (@target) { my $ext = $1; $ext =~ s!-!::!g; print "\t$ext\n"; - if ( open( my $pkg, $lst ) ) { + if ( open( my $pkg, '<', $lst ) ) { while (<$pkg>) { if (m!^"(.+)"-"(.+)"$!) { my ( $src, $dst ) = ( $1, $2 ); @@ -165,7 +165,7 @@ qq[;Supports Series 80 v2.0\n(0x101F8ED2), 0, 0, 0, {"Series80ProductID"}\n] : qq[;Supports Series 90 v1.1\n(0x101FBE05), 0, 0, 0, {"Series90ProductID"}\n] : ";Supports Series NN"; - open PKG, ">$pkg" or die "$0: failed to create $pkg: $!\n"; + open PKG, '>', $pkg or die "$0: failed to create $pkg: $!\n"; print PKG <<__EOF__; ; \u$target installation script ; diff --git a/symbian/sisify.pl b/symbian/sisify.pl index fc82ae7698..7b5506c13f 100644 --- a/symbian/sisify.pl +++ b/symbian/sisify.pl @@ -188,9 +188,9 @@ $OWD =~ s!/!\\!g; chdir($tempdir) or die "$0: chdir('$tempdir')\n"; if (@SisPl) { - if (open(my $fi, "default.pl")) { + if (open(my $fi, "<", "default.pl")) { my $fn = "default.pl.new"; - if (open(my $fo, ">$fn")) { + if (open(my $fo, ">", $fn)) { while (<$fi>) { last unless /^\#/; print $fo $_; @@ -254,7 +254,7 @@ unless ($Library) { my $cmd = "uidcrc $uids |"; - if (open(my $fh, $cmd)) { + if (open(my $fh, '<', $cmd)) { my $line = <$fh>; close($fh); # 0x10000079 0x100039ce 0x0acebabe 0xc82b1900 @@ -285,7 +285,7 @@ unless ($Library) { my $UID_OFFSET = 0x0C7C; # This is where the uid is in the $app. substr($app, $UID_OFFSET, 4) = substr($app, 8, 4); # Copy the uid also here. - if (open(my $fh, ">$AppName.app")) { + if (open(my $fh, '>', "$AppName.app")) { binmode($fh); print $fh $app; close($fh); @@ -295,7 +295,7 @@ unless ($Library) { push @pkg, qq["$AppName.app"-"!:\\system\\apps\\$AppName\\$AppName.app"]; - if (open(my $fh, ">$AppName.rsc")) { + if (open(my $fh, '>', "$AppName.rsc")) { binmode($fh); print $fh hex2data($RSCHEX); close($fh); @@ -311,7 +311,7 @@ if ($ShowPkg) { } } else { my $fn = "$AppName.pkg"; - if (open(my $fh, ">$fn")) { + if (open(my $fh, '>', $fn)) { for my $l (@pkg) { print $fh "$l\r\n"; # Note CRLF! } diff --git a/symbian/version.pl b/symbian/version.pl index c8bb82ebf7..f4208f873f 100644 --- a/symbian/version.pl +++ b/symbian/version.pl @@ -2,7 +2,7 @@ use strict; my %VERSION; -if (open(PATCHLEVEL_H, "patchlevel.h")) { +if (open(PATCHLEVEL_H, "<", "patchlevel.h")) { while (<PATCHLEVEL_H>) { if (/#define\s+PERL_(REVISION|VERSION|SUBVERSION)\s+(\d+)/) { $VERSION{$1} = $2; diff --git a/symbian/xsbuild.pl b/symbian/xsbuild.pl index 939b569101..5ccd7c379e 100644 --- a/symbian/xsbuild.pl +++ b/symbian/xsbuild.pl @@ -137,7 +137,7 @@ my %EXTCFG; sub write_bld_inf { my ($base) = @_; print "\tbld.inf\n"; - open( BLD_INF, ">bld.inf" ) or die "$0: bld.inf: $!\n"; + open( BLD_INF, '>', 'bld.inf' ) or die "$0: bld.inf: $!\n"; print BLD_INF <<__EOF__; PRJ_MMPFILES $base.mmp @@ -188,7 +188,7 @@ sub uniquefy_filenames { sub read_mmp { my ( $conf, $mmp ) = @_; - if ( -r $mmp && open( MMP, "<$mmp" ) ) { + if ( -r $mmp && open( MMP, '<', $mmp ) ) { print "\tReading $mmp...\n"; while (<MMP>) { chomp; @@ -269,7 +269,7 @@ sub write_mmp { for my $u (qw(SOURCE SOURCEPATH SYSTEMINCLUDE USERINCLUDE LIBRARY MACRO)) { $CONF{$u} = uniquefy_filenames( $CONF{$u} ); } - open( BASE_MMP, ">$base.mmp" ) or die "$0: $base.mmp: $!\n"; + open( BASE_MMP, '>', "$base.mmp" ) or die "$0: $base.mmp: $!\n"; print BASE_MMP <<__EOF__; TARGET $CONF{TARGET} @@ -310,7 +310,7 @@ sub write_makefile { my $wrap = $SYMBIAN_ROOT && defined $SDK_VARIANT eq 'S60' && $SDK_VERSION eq '1.2' && $SYMBIAN_ROOT !~ /_CW$/; my $ABLD = $wrap ? 'perl b.pl' : 'abld'; - open( MAKEFILE, ">Makefile" ) or die "$0: Makefile: $!\n"; + open( MAKEFILE, '>', 'Makefile' ) or die "$0: Makefile: $!\n"; print MAKEFILE <<__EOF__; WIN = $WIN ARM = $ARM @@ -382,7 +382,7 @@ distclean: defrost realclean __EOF__ close(MAKEFILE); if ($wrap) { - if(open(B,">b.pl")) { + if(open(B, '>', 'b.pl')) { print B <<'__EOF__'; # abld.pl wrapper. @@ -420,7 +420,7 @@ sub patch_config { return unless $CoreBuild; my $V = sprintf "%vd", $^V; # create reverse patch script - if (open(RSCRIPT, ">$config_restore_script")) { + if (open(RSCRIPT, '>', $config_restore_script)) { print RSCRIPT <<__EOF__; #!perl -pi.bak s:\\Q$V:$R_V_SV: @@ -590,7 +590,7 @@ sub xsconfig { my @MM = qw(VERSION XS_VERSION); if ( -f "Makefile" ) { print "\tReading MakeMaker Makefile...\n"; - if ( open( MAKEFILE, "Makefile" ) ) { + if ( open( MAKEFILE, '<', 'Makefile' ) ) { while (<MAKEFILE>) { for my $m (@MM) { if (m!^$m = (.+)!) { @@ -617,7 +617,7 @@ sub xsconfig { } (&restore_config and die "$0: VERSION or XS_VERSION undefined\n") unless defined $MM{VERSION} && defined $MM{XS_VERSION}; - if ( open( BASE_C, ">$basec" ) ) { + if ( open( BASE_C, '>', $basec ) ) { print BASE_C <<__EOF__; #ifndef VERSION #define VERSION "$MM{VERSION}" @@ -643,7 +643,7 @@ __EOF__ } print "\t_init.c\n"; - open( _INIT_C, ">_init.c" ) + open( _INIT_C, '>', '_init.c' ) or &restore_config and die "$!: _init.c: $!\n"; print _INIT_C <<__EOF__; #include "EXTERN.h" @@ -659,7 +659,7 @@ __EOF__ for my $submf ( glob("*/Makefile") ) { my $d = dirname($submf); print "Configuring Encode::$d...\n"; - if ( open( SUBMF, $submf ) ) { + if ( open( SUBMF, '<', $submf ) ) { if ( update_dir($d) ) { my @subsrc; while (<SUBMF>) { @@ -715,7 +715,7 @@ __EOF__ print "\t$lstname.lst\n"; my $lstout = $CoreBuild ? "$BUILDROOT/symbian/$lstname.lst" : "$BUILDROOT/$lstname.lst"; - if ( open( my $lst, ">$lstout" ) ) { + if ( open( my $lst, '>', $lstout ) ) { for my $f (@lst) { print $lst qq["$f"-"!:$lst{$f}"\n] } close($lst); } @@ -787,7 +787,7 @@ for my $ext (@ARGV) { if $CoreBuild && $Build && !-f "lib\\Config.pm"; if ($CoreBuild) { - open( my $cfg, "symbian/install.cfg" ) + open( my $cfg, '<', 'symbian/install.cfg' ) or die "$0: symbian/install.cfg: $!\n"; my $extdir = $dir; $extdir =~ s:^ext\\::; @@ -864,7 +864,7 @@ for my $ext (@ARGV) { system_echo("make @TARGET") == 0 or die "$0: make #2 failed\n"; unlink("$base.mmp.bak"); - open( _INIT_C, ">_init.c" ) or die "$0: _init.c: $!\n"; + open( _INIT_C, '>', '_init.c' ) or die "$0: _init.c: $!\n"; print _INIT_C <<'__EOF__'; #include "EXTERN.h" #include "perl.h" @@ -885,7 +885,7 @@ __EOF__ for my $f ("$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$base\\WINS\\perl$VERSION-$extdash.def", "..\\BMARM\\perl$VERSION-${extdash}u.def") { print "\t($f - "; - if ( open( $def, $f ) ) { + if ( open( $def, '<', $f ) ) { print "OK)\n"; $basef = $f; last; diff --git a/t/loc_tools.pl b/t/loc_tools.pl index 50b36d5056..0e4453b314 100644 --- a/t/loc_tools.pl +++ b/t/loc_tools.pl @@ -299,7 +299,7 @@ sub find_locales ($;$) { delete local @ENV{qw(IFS CDPATH ENV BASH_ENV)}; if (-x "/usr/bin/locale" - && open(LOCALES, "/usr/bin/locale -a 2>/dev/null|")) + && open(LOCALES, '-|', "/usr/bin/locale -a 2>/dev/null")) { while (<LOCALES>) { # It seems that /usr/bin/locale steadfastly outputs 8 bit data, which @@ -978,7 +978,7 @@ sub fresh_perl { $runperl_args->{progfile} ||= $tmpfile; $runperl_args->{stderr} = 1 unless exists $runperl_args->{stderr}; - open TEST, ">$tmpfile" or die "Cannot open $tmpfile: $!"; + open TEST, '>', $tmpfile or die "Cannot open $tmpfile: $!"; print TEST $prog; close TEST or die "Cannot close $tmpfile: $!"; 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 { diff --git a/vms/gen_shrfls.pl b/vms/gen_shrfls.pl index 570a946d40..6ed7eca9d9 100644 --- a/vms/gen_shrfls.pl +++ b/vms/gen_shrfls.pl @@ -38,7 +38,7 @@ my $debug = $ENV{'GEN_SHRFLS_DEBUG'}; print "gen_shrfls.pl Rev. 8-Jul-2011\n" if $debug; if ($ARGV[0] eq '-f') { - open(INP,$ARGV[1]) or die "Can't read input file $ARGV[1]: $!\n"; + open(INP,'<',$ARGV[1]) or die "Can't read input file $ARGV[1]: $!\n"; print "Input taken from file $ARGV[1]\n" if $debug; @ARGV = (); while (<INP>) { @@ -205,7 +205,7 @@ elsif (@symfiles) { $incstr .= ',' . join(',',@symfiles); } # Linker wants /Include and /Library on different lines print OPTBLD "$libperl/Include=($incstr)\n"; print OPTBLD "$libperl/Library\n"; -open(RTLOPT,$rtlopt) or die "$0: Can't read options file $rtlopt: $!\n"; +open(RTLOPT,'<',$rtlopt) or die "$0: Can't read options file $rtlopt: $!\n"; while (<RTLOPT>) { print OPTBLD; } close RTLOPT; close OPTBLD; diff --git a/vms/mms2make.pl b/vms/mms2make.pl index 1706c51283..7a83052acf 100644 --- a/vms/mms2make.pl +++ b/vms/mms2make.pl @@ -38,8 +38,8 @@ $macros{"DECC"} = 1 if $macros{"__AXP__"}; # [lazy - saves having to check for empty array - just test [0]==1] @conditions = (1); -open(INFIL,$infile) || die "Can't open $infile: $!\n"; -open(OUTFIL,">$outfile") || die "Can't open $outfile: $!\n"; +open(INFIL,'<',$infile) || die "Can't open $infile: $!\n"; +open(OUTFIL,'>',$outfile) || die "Can't open $outfile: $!\n"; print OUTFIL "#> This file produced from $infile by $0\n"; print OUTFIL "#> Lines beginning with \"#>\" were commented out during the\n"; diff --git a/win32/bin/exetype.pl b/win32/bin/exetype.pl index 27e3b94bc8..203f554d36 100644 --- a/win32/bin/exetype.pl +++ b/win32/bin/exetype.pl @@ -23,7 +23,7 @@ unless (@ARGV == 1 || defined $subsys{$ARGV[1]}) { } my ($record,$magic,$signature,$offset,$size); -open EXE, "+< $ARGV[0]" or die "Cannot open $ARGV[0]: $!\n"; +open EXE, '+<', $ARGV[0] or die "Cannot open $ARGV[0]: $!\n"; binmode EXE; # read IMAGE_DOS_HEADER structure diff --git a/win32/bin/pl2bat.pl b/win32/bin/pl2bat.pl index b30b16b03d..443f5909e0 100644 --- a/win32/bin/pl2bat.pl +++ b/win32/bin/pl2bat.pl @@ -84,7 +84,7 @@ sub process { my $line; my $start= $Config{startperl}; $start= "#!perl" unless $start =~ /^#!.*perl/; - open( FILE, $file ) or die "$0: Can't open $file: $!"; + open( FILE, '<', $file ) or die "$0: Can't open $file: $!"; @file = <FILE>; foreach $line ( @file ) { $linenum++; @@ -111,7 +111,7 @@ sub process { close( FILE ); $file =~ s/$OPT{'s'}$//oi; $file .= '.bat' unless $file =~ /\.bat$/i or $file =~ /^-$/; - open( FILE, ">$file" ) or die "Can't open $file: $!"; + open( FILE, '>', $file ) or die "Can't open $file: $!"; print FILE $myhead; print FILE $start, ( $OPT{'w'} ? " -w" : "" ), "\n#line ", ($headlines+1), "\n" unless $linedone; diff --git a/win32/bin/search.pl b/win32/bin/search.pl index 8f4d7391f3..cd6e6adf5e 100644 --- a/win32/bin/search.pl +++ b/win32/bin/search.pl @@ -626,7 +626,7 @@ sub read_rc { package magic; $^W= 0; } ## turn off warnings for when we run EXPR's - unless (open(RC, "$file")) { + unless (open(RC, '<', $file)) { $use_default=1; $file = "<internal default startup file>"; ## no RC file -- use this default. @@ -950,7 +950,7 @@ sub dodir } if ($DO_MAGIC_TESTS) { - if (!open(FILE_IN, $file)) { + if (!open(FILE_IN, '<', $file)) { &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT; warn qq/$0: can't open: $file\n/; next; @@ -990,7 +990,7 @@ sub dodir next; } else { ## if we weren't doing magic tests, file won't be open yet... - if (!$DO_MAGIC_TESTS && !open(FILE_IN, $file)) { + if (!$DO_MAGIC_TESTS && !open(FILE_IN, '<', $file)) { &clear_message if $VERBOSE && $STDERR_SCREWS_STDOUT; warn qq/$0: can't open: $file\n/; next; diff --git a/win32/ce-helpers/makedist.pl b/win32/ce-helpers/makedist.pl index 7cfdc366d9..2ad0f70c9f 100644 --- a/win32/ce-helpers/makedist.pl +++ b/win32/ce-helpers/makedist.pl @@ -101,7 +101,7 @@ for (@efiles) { my ($dynaloader_pm); if ($opts{adaptation}) { # let's copy our Dynaloader.pm (make this optional?) - open my $fhdyna, ">$opts{distdir}/lib/Dynaloader.pm"; + open my $fhdyna, '>', "$opts{distdir}/lib/Dynaloader.pm"; print $fhdyna $dynaloader_pm; close $fhdyna; } @@ -138,7 +138,7 @@ for (@afiles) { sub copy($$) { my ($fnfrom, $fnto) = @_; - open my $fh, "<$fnfrom" or die "can not open $fnfrom: $!"; + open my $fh, '<', $fnfrom or die "can not open $fnfrom: $!"; binmode $fh; local $/; my $ffrom = <$fh>; @@ -153,7 +153,7 @@ sub copy($$) { } } mkpath $1 if $fnto=~/^(.*)\/([^\/]+)$/; - open my $fhout, ">$fnto"; + open my $fhout, '>', $fnto; binmode $fhout; print $fhout $ffrom; if ($opts{'verbose'} >=2) { diff --git a/win32/config_h.PL b/win32/config_h.PL index 89c7a20dcb..e755007f73 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -26,7 +26,7 @@ $opt{CORE_DIR} ||= '../lib/CORE'; warn "Writing $opt{CONFIG_H}\n"; -open(SH,"<$name") || die "Cannot open $name:$!"; +open(SH, "<", $name) || die "Cannot open $name:$!"; while (<SH>) { last if /^\s*sed/; @@ -50,7 +50,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); while (<SH>) { diff --git a/win32/config_sh.PL b/win32/config_sh.PL index 74e5f0dd4b..c4a311266d 100644 --- a/win32/config_sh.PL +++ b/win32/config_sh.PL @@ -22,7 +22,7 @@ sub loadopts { shift @ARGV; my $optfile = shift @ARGV; local (*OPTF); - 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 = <OPTF>); my @vars = split(/\t+~\t+/, $line); @@ -59,7 +59,7 @@ $opt{known_extensions} = join(' ',FindExt::known_extensions()) || ' '; 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 (<PL>) { if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) { $opt{$1} = $2; |