summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2001-11-02 15:07:11 +0000
committerAbhijit Menon-Sen <ams@wiw.org>2001-11-02 15:07:11 +0000
commit8be1be9027535daad1bce57b01a65406b28b3a19 (patch)
treebb28ef1da37bd95e2ee18034e1024a21ebf40944 /op.c
parent58d9517576e61e077f66c327ee4c44c5d9bbf1a7 (diff)
downloadperl-8be1be9027535daad1bce57b01a65406b28b3a19.tar.gz
Slight modification of #12811.
p4raw-id: //depot/perl@12812
Diffstat (limited to 'op.c')
-rw-r--r--op.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/op.c b/op.c
index 4b00e0f30e..55f1756440 100644
--- a/op.c
+++ b/op.c
@@ -1670,22 +1670,27 @@ Perl_mod(pTHX_ OP *o, I32 type)
goto nomod;
break; /* mod()ing was handled by ck_return() */
}
- if (type != OP_REFGEN ||
- PL_check[o->op_type] != MEMBER_TO_FPTR(Perl_ck_ftst)) {
- if (type != OP_LEAVESUBLV)
- o->op_flags |= OPf_MOD;
- if (type == OP_AASSIGN || type == OP_SASSIGN)
- o->op_flags |= OPf_SPECIAL|OPf_REF;
- else if (!type) {
- o->op_private |= OPpLVAL_INTRO;
- o->op_flags &= ~OPf_SPECIAL;
- PL_hints |= HINT_BLOCK_SCOPE;
- }
- else if (type != OP_GREPSTART && type != OP_ENTERSUB
- && type != OP_LEAVESUBLV)
- o->op_flags |= OPf_REF;
+ /* [20011101.069] File test operators interpret OPf_REF to mean that
+ their argument is a filehandle; thus \stat(".") should not set
+ it. AMS 20011102 */
+ if (type == OP_REFGEN &&
+ PL_check[o->op_type] == MEMBER_TO_FPTR(Perl_ck_ftst))
+ return o;
+
+ if (type != OP_LEAVESUBLV)
+ o->op_flags |= OPf_MOD;
+
+ if (type == OP_AASSIGN || type == OP_SASSIGN)
+ o->op_flags |= OPf_SPECIAL|OPf_REF;
+ else if (!type) {
+ o->op_private |= OPpLVAL_INTRO;
+ o->op_flags &= ~OPf_SPECIAL;
+ PL_hints |= HINT_BLOCK_SCOPE;
}
+ else if (type != OP_GREPSTART && type != OP_ENTERSUB
+ && type != OP_LEAVESUBLV)
+ o->op_flags |= OPf_REF;
return o;
}