summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-21 23:43:17 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-22 00:07:20 -0800
commit84ed01088568ffe9cf49047f10500ca511db0c9e (patch)
tree614defca700a49e07194fa9e5b177120fc2ba50b /pp.c
parent8f84cc86e11f13b85c64fd0205261e12bef9e7f9 (diff)
downloadperl-84ed01088568ffe9cf49047f10500ca511db0c9e.tar.gz
[perl #80628] __SUB__
After much alternation, altercation and alteration, __SUB__ is finally here.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 7011ecfc95..27d6a00b0f 100644
--- a/pp.c
+++ b/pp.c
@@ -5794,6 +5794,25 @@ PP(pp_coreargs)
RETURN;
}
+PP(pp_runcv)
+{
+ dSP;
+ CV *cv;
+ if (PL_op->op_private & OPpOFFBYONE) {
+ PERL_SI * const oldsi = PL_curstackinfo;
+ I32 const oldcxix = oldsi->si_cxix;
+ if (oldcxix) oldsi->si_cxix--;
+ else PL_curstackinfo = oldsi->si_prev;
+ cv = find_runcv(NULL);
+ PL_curstackinfo = oldsi;
+ oldsi->si_cxix = oldcxix;
+ }
+ else cv = find_runcv(NULL);
+ XPUSHs(CvUNIQUE(cv) ? &PL_sv_undef : sv_2mortal(newRV((SV *)cv)));
+ RETURN;
+}
+
+
/*
* Local variables:
* c-indentation-style: bsd