From 1efec5ed466a1faf287ecbdfe8715be7ffef7712 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 29 Apr 2012 21:15:25 -0700 Subject: Add &CORE::pos --- pp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pp.c') diff --git a/pp.c b/pp.c index b1ab8b9a38..c89b083b82 100644 --- a/pp.c +++ b/pp.c @@ -5934,6 +5934,7 @@ PP(pp_coreargs) whicharg++; switch (oa & 7) { case OA_SCALAR: + try_defsv: if (!numargs && defgv && whicharg == minargs + 1) { PERL_SI * const oldsi = PL_curstackinfo; I32 const oldcxix = oldsi->si_cxix; @@ -5981,7 +5982,8 @@ PP(pp_coreargs) } break; case OA_SCALARREF: - { + if (!numargs) goto try_defsv; + else { const bool wantscalar = PL_op->op_private & OPpCOREARGS_SCALARMOD; if (!svp || !*svp || !SvROK(*svp) @@ -6005,8 +6007,8 @@ PP(pp_coreargs) : "reference to one of [$@%*]" ); PUSHs(SvRV(*svp)); - break; } + break; default: DIE(aTHX_ "panic: unknown OA_*: %x", (unsigned)(oa&7)); } -- cgit v1.2.1