Show quoted text > It occurs to me that the anon_scalar could be used to store its ID.
> Instead of using $root_of{ident $self} we would write
> $root_of{$$self}. I'm sure I don't understand all the implications of
> this (threads etc) but it seems like trading a dereference for a
> function call should be a performance win, and I find it less
> cluttered visually.
Sure, but it also means that you can duplicate an object just by duplicating
its contents. Which also means you can spoof any object just be replacing the
contents with a value that happens to be the ID of another.
That's why I decided against caching the key in the object.
Of course, nothing prevents you from doing this manually yourself. For
example, you could set up a BUILD that includes:
$$self = ident $self;
and thereafter use $someattr_of{$$self} as you wish.
Damian