summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index d720b70006..078db3bfd1 100644
--- a/pp.c
+++ b/pp.c
@@ -5325,6 +5325,24 @@ PP(unimplemented_op)
PL_op->op_type);
}
+PP(pp_boolkeys)
+{
+ dVAR;
+ dSP;
+ HV * const hv = (HV*)POPs;
+
+ if (SvRMAGICAL(hv)) {
+ MAGIC * const mg = mg_find((SV*)hv, PERL_MAGIC_tied);
+ if (mg) {
+ XPUSHs(magic_scalarpack(hv, mg));
+ RETURN;
+ }
+ }
+
+ XPUSHs(boolSV(HvKEYS(hv) != 0));
+ RETURN;
+}
+
/*
* Local variables:
* c-indentation-style: bsd