diff options
author | Dan Collins <dcollinsn@gmail.com> | 2016-03-30 16:42:39 +1100 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2016-04-07 07:45:08 -0400 |
commit | 8f6eb0aa5efb953e32803878cca6d9c1e28ac03f (patch) | |
tree | 28c475d036a9b1023371f30dd05f705ce46b4fd1 /op.c | |
parent | 45d40326f89400e722587fa76ee587404ef594f9 (diff) | |
download | perl-8f6eb0aa5efb953e32803878cca6d9c1e28ac03f.tar.gz |
(perl #126162) warn if stat() is called on an array
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -9733,6 +9733,10 @@ Perl_ck_ftst(pTHX_ OP *o) 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; |