b
returns the value of $newdata
, which is a reference to an anon hash, which holds a reference to %a
, which holds a scalar in the element with key boo
.
If the value returned by b
not stored, nothing will be referencing the value of $newdata
, so it will get freed, so nothing will be referencing the anon hash, so it will get freed, so nothing will reference the scalar in the element with key boo
, so it will get freed.
No cycles. No leak.