This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
document what Perl_doref does
authorDavid Mitchell <davem@iabyn.com>
Fri, 31 May 2019 09:27:25 +0000 (10:27 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 24 Jun 2019 10:40:07 +0000 (11:40 +0100)
op.c

diff --git a/op.c b/op.c
index 997806c..19ba06b 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4670,6 +4670,19 @@ S_refkids(pTHX_ OP *o, I32 type)
     return o;
 }
 
+
+/* Apply reference (autovivification) context to the subtree at o.
+ * For example in
+ *     push @{expression}, ....;
+ * o will be the head of 'expression' and type will be OP_RV2AV.
+ * It marks the op o (or a suitable child) as autovivifying, e.g. by
+ * setting  OPf_MOD.
+ * For OP_RV2AV/OP_PADAV and OP_RV2HV/OP_PADHV sets OPf_REF too if
+ * set_op_ref is true.
+ *
+ * Also calls scalar(o).
+ */
+
 OP *
 Perl_doref(pTHX_ OP *o, I32 type, bool set_op_ref)
 {