diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-26 18:19:14 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-26 18:19:14 -0700 |
commit | 3e6568b4d097eff42dadf96c5f05b8b02fd9dc29 (patch) | |
tree | f023cfe4fe92cf0221ee606395d2845d660d7600 /pp.c | |
parent | 8258719730b59de406fa34e6a4bbcc71771803be (diff) | |
download | perl-3e6568b4d097eff42dadf96c5f05b8b02fd9dc29.tar.gz |
&CORE::open()
This commit allows &CORE::open to be called through references or with
ampersand syntax. It modifies pp_coreargs not to push nulls for ops
that require a pushmark.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -6017,6 +6017,7 @@ PP(pp_coreargs) I32 oa = opnum ? PL_opargs[opnum] >> OASHIFT : 0; bool seen_question = 0; const char *err = NULL; + const bool pushmark = PL_op->op_private & OPpCOREARGS_PUSHMARK; /* Count how many args there are first, to get some idea how far to extend the stack. */ @@ -6049,7 +6050,7 @@ PP(pp_coreargs) /* We do this here, rather than with a separate pushmark op, as it has to come in between two things this function does (stack reset and arg pushing). This seems the easiest way to do it. */ - if (PL_op->op_private & OPpCOREARGS_PUSHMARK) { + if (pushmark) { PUTBACK; (void)Perl_pp_pushmark(aTHX); } @@ -6072,7 +6073,7 @@ PP(pp_coreargs) ); oa >>= 4; } - for (;oa;(void)(numargs&&(++svp,--numargs))) { + for (; oa&&(numargs||!pushmark); (void)(numargs&&(++svp,--numargs))) { whicharg++; switch (oa & 7) { case OA_SCALAR: |