summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2020-02-05 07:43:14 +0000
committerKarl Williamson <khw@cpan.org>2020-03-12 22:34:26 -0600
commit02b85d3dab092d678cfc958a2dc252405333ed25 (patch)
tree106c8bfafd35b0d496133efad370973e7f2988d9 /pp.c
parentaa4119bb5f3a35b89e89d3504835f8da0d933e3d (diff)
downloadperl-02b85d3dab092d678cfc958a2dc252405333ed25.tar.gz
chained comparisons
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 980a4c3579..0da2e3e3e6 100644
--- a/pp.c
+++ b/pp.c
@@ -7130,6 +7130,30 @@ PP(pp_isa)
RETURN;
}
+PP(pp_cmpchain_and)
+{
+ dSP;
+ SV *result = POPs;
+ PUTBACK;
+ if (SvTRUE_NN(result)) {
+ return cLOGOP->op_other;
+ } else {
+ TOPs = result;
+ return NORMAL;
+ }
+}
+
+PP(pp_cmpchain_dup)
+{
+ dSP;
+ SV *right = TOPs;
+ SV *left = TOPm1s;
+ TOPm1s = right;
+ TOPs = left;
+ XPUSHs(right);
+ RETURN;
+}
+
/*
* ex: set ts=8 sts=4 sw=4 et:
*/