op_free(o);
return newop;
}
+
+ if (kidtype == OP_RV2AV) {
+ Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Array passed to stat will be coerced to a scalar (did you want stat $_[0]?)");
+ }
scalar((OP *) kid);
if ((PL_hints & HINT_FILETEST_ACCESS) && OP_IS_FILETEST_ACCESS(o->op_type))
o->op_private |= OPpFT_ACCESS;
${^WIN32_SLOPPY_STAT} = 0;
}
-plan tests => 116;
+plan tests => 118;
my $Perl = which_perl();
is join("-", 1,2,3,(stat stat stat),4,5,6), "1-2-3-4-5-6",
'stat inside stat gets scalar context';
+# [perl #126162] stat an array should not work
+my $statfile = './op/stat.t';
+my @statarg = ($statfile, $statfile);
+ok !stat(@statarg),
+ 'stat on an array of valid paths should warn and should not return any data';
+is $!, 'No such file or directory',
+ 'stat on an array of valid paths should return "No such file or directory"';
+
END {
chmod 0666, $tmpfile;
unlink_all $tmpfile;