diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-24 02:34:20 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-24 02:34:20 +0000 |
commit | 9675f7ac35061616b1770751dc4303671c1e0ebe (patch) | |
tree | 9292a3b5defc622fc0465fba8fdbfc0e984aaa8b /op.c | |
parent | 18228614d1dac2db099ef3d8846e53f44accce72 (diff) | |
download | perl-9675f7ac35061616b1770751dc4303671c1e0ebe.tar.gz |
oops, some files missing in change#3449
p4raw-link: @3449 on //depot/perl: 18228614d1dac2db099ef3d8846e53f44accce72
p4raw-id: //depot/perl@3450
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -5412,6 +5412,31 @@ ck_subr(OP *o) goto wrapref; /* autoconvert GLOB -> GLOBref */ else if (o2->op_type == OP_CONST) o2->op_private &= ~OPpCONST_STRICT; + else if (o2->op_type == OP_ENTERSUB) { + /* accidental subroutine, revert to bareword */ + OP *gvop = ((UNOP*)o2)->op_first; + if (gvop && gvop->op_type == OP_NULL) { + gvop = ((UNOP*)gvop)->op_first; + if (gvop) { + for (; gvop->op_sibling; gvop = gvop->op_sibling) + ; + if (gvop && + (gvop->op_private & OPpENTERSUB_NOPAREN) && + (gvop = ((UNOP*)gvop)->op_first) && + gvop->op_type == OP_GV) + { + GV *gv = (GV*)((SVOP*)gvop)->op_sv; + OP *sibling = o2->op_sibling; + op_free(o2); + o2 = newSVOP(OP_CONST, 0, + newSVpvn(GvNAME(gv), + GvNAMELEN(gv))); + prev->op_sibling = o2; + o2->op_sibling = sibling; + } + } + } + } scalar(o2); break; case '\\': |