This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Bring the joy of strict (and warnings) to lib/File/stat.t
authorNicholas Clark <nick@ccl4.org>
Sun, 3 Jun 2012 09:42:20 +0000 (11:42 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 21 Jun 2012 06:58:59 +0000 (08:58 +0200)
lib/File/stat.t

index c98d64d..eb8fdd0 100644 (file)
@@ -5,9 +5,13 @@ BEGIN {
     @INC = '../lib';
 }
 
     @INC = '../lib';
 }
 
+use strict;
+use warnings;
 use Test::More;
 use Config qw( %Config );
 
 use Test::More;
 use Config qw( %Config );
 
+my $file;
+
 BEGIN {
     # Check whether the build is configured with -Dmksymlinks
     our $Dmksymlinks =
 BEGIN {
     # Check whether the build is configured with -Dmksymlinks
     our $Dmksymlinks =
@@ -18,7 +22,7 @@ BEGIN {
     # with -Dmksymlinks
     # Originally we worked with ./TEST, but other test scripts read from
     # that file and modify its access time.
     # with -Dmksymlinks
     # Originally we worked with ./TEST, but other test scripts read from
     # that file and modify its access time.
-    our $file = '../lib/File/stat.t';
+    $file = '../lib/File/stat.t';
     if ( $Dmksymlinks ) {
         $file = readlink $file;
         die "Can't readlink(../lib/File/stat.t): $!" if ! defined $file;
     if ( $Dmksymlinks ) {
         $file = readlink $file;
         die "Can't readlink(../lib/File/stat.t): $!" if ! defined $file;
@@ -131,7 +135,6 @@ SKIP: {
 {   # 111640 - File::stat bogus index check in overload
 
     use filetest "access";
 {   # 111640 - File::stat bogus index check in overload
 
     use filetest "access";
-    use warnings;
     for my $op (split //, "rwxRXW") {
        # these should all warn with filetest access
        my $w;
     for my $op (split //, "rwxRXW") {
        # these should all warn with filetest access
        my $w;