Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^4: Attempt to free unreferenced scalar

by tqisjim (Beadle)
on Mar 20, 2013 at 15:12 UTC ( #1024535=note: print w/ replies, xml ) Need Help??

in reply to Re^3: Attempt to free unreferenced scalar
in thread Attempt to free unreferenced scalar

Thanks again for the helpful response.

My understanding is that Perl will not try to free() a weak reference. But I seem to recall reading that a weak reference is copied as a strong reference. If true, that might explain everything, since the copy will trigger free() on memory already unallocated.

I'm probably out of my league, but I assume that a weak reference copy should also be weak. Is this behavior limited to 5.10 and 5.12? Certainly a neat and tidy explanation and a manageable workaround. You're probably the best resource for sanity checking that theory. And then, is it possible to confirm by rooting around the change logs?

It's always a exciting... and a little scary... to get so close to the internals ;)

Comment on Re^4: Attempt to free unreferenced scalar
Replies are listed 'Best First'.
Re^5: Attempt to free unreferenced scalar
by ikegami (Pope) on Mar 24, 2013 at 07:22 UTC

    Weak refs just cause scalars to get undefined.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024535]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-11-30 10:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls