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
[perl5.git] / lib / File / stat.pm
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'");