This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[rt #111640] warn on the right -X operators used on a File::stat object
authorTony Cook <tony@develop-help.com>
Mon, 12 Mar 2012 09:08:01 +0000 (20:08 +1100)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 22 May 2012 00:51:52 +0000 (17:51 -0700)
lib/File/stat.pm
lib/File/stat.t

index 69cc44a..34c883b 100644 (file)
@@ -10,7 +10,7 @@ BEGIN { *warnif = \&warnings::warnif }
 
 our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS);
 
-our $VERSION = '1.05';
+our $VERSION = '1.06';
 
 my @fields;
 BEGIN { 
@@ -148,7 +148,7 @@ use overload
     -X => sub {
         my ($s, $op) = @_;
 
-        if (index "rwxRWX", $op) {
+        if (index("rwxRWX", $op) >= 0) {
             (caller 0)[8] & HINT_FILETEST_ACCESS
                 and warnif("File::stat ignores use filetest 'access'");
 
index 74bf5fb..32a7481 100644 (file)
@@ -142,7 +142,6 @@ SKIP: {
     use filetest "access";
     use warnings;
     for my $op (split //, "rwxRXW") {
-       local $TODO = $op eq "r" ? "RT 111640" : "";
        # these should all warn with filetest access
        my $w;
        local $SIG{__WARN__} = sub { $w = shift };
@@ -152,7 +151,6 @@ SKIP: {
     }
 
     {
-       local $TODO = "RT 111640";
        # -d and others shouldn't warn
        my $w;
        local $SIG{__WARN__} = sub { $w = shift };