in reply to Re^2: Is it possible to obtain all hardreferences to some memory address by knowing only one of them?
in thread Is it possible to obtain all hardreferences to some memory address by knowing only one of them?
Please explain why you'd want to do this, because you're trying to do something that you'd normally never want to do, and perl is in fact designed to stop you doing this.
Any way, if i had to, I'd probably resort to Tie::Scalar to fake a reference and return weak-references whenever someone tries to copy it*). Very non-intuitive, slow and confusing, but at least sort of portable. Also, that way you could throw some stack-traces to STDERR to see where the **** your references get copied.
*) now that I think about it, I'm not even sure that would work.
|
|---|