diff options
-rw-r--r-- | doop.c | 5 | ||||
-rw-r--r-- | pod/perlref.pod | 4 |
2 files changed, 5 insertions, 4 deletions
@@ -1067,10 +1067,9 @@ do_kv(ARGSproto) if (dokeys) XPUSHs(hv_iterkeysv(entry)); /* won't clobber stack_sp */ if (dovalues) { - tmpstr = sv_newmortal(); PUTBACK; - sv_setsv(tmpstr,realhv ? - hv_iterval(hv,entry) : avhv_iterval((AV*)hv,entry)); + tmpstr = realhv ? + hv_iterval(hv,entry) : avhv_iterval((AV*)hv,entry); DEBUG_H(sv_setpvf(tmpstr, "%lu%%%d=%lu", (unsigned long)HeHASH(entry), HvMAX(keys)+1, diff --git a/pod/perlref.pod b/pod/perlref.pod index 66b1a7d7c1..aa4ddfbbfe 100644 --- a/pod/perlref.pod +++ b/pod/perlref.pod @@ -89,7 +89,9 @@ a list of references! @list = \($a, @b, %c); # same thing! As a special case, C<\(@foo)> returns a list of references to the contents -of C<@foo>, not a reference to C<@foo> itself. Likewise for C<%foo>. +of C<@foo>, not a reference to C<@foo> itself. Likewise for C<%foo>, +except that the key references are to copies (since the keys are just +strings rather than full-fledged scalars). =item 3. |