summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-26 18:19:14 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-26 18:19:14 -0700
commit3e6568b4d097eff42dadf96c5f05b8b02fd9dc29 (patch)
treef023cfe4fe92cf0221ee606395d2845d660d7600 /pp.c
parent8258719730b59de406fa34e6a4bbcc71771803be (diff)
downloadperl-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index fd17bc1299..78b1271050 100644
--- a/pp.c
+++ b/pp.c
@@ -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: