in reply to Inside Out Classes and the internal Hashes

There's nothing fundamentally wrong with your approach. The main difference is that using a separate hash for each property means you get "automatic spellchecking" of properties:
use strict; my %prop; sub method { my ($self) = @_; $prXp{id($self)} = 1; # throws an error: $prXp is not declared }
And using separate hashes means less typing.

One other thing: using refaddr is not safe when using fork() (on windows) or threads (on any system) since the refaddr changes over a CLONE. Object::InsideOut seems to deal with this issue.

Replies are listed 'Best First'.
Re^2: Inside Out Classes and the internal Hashes
by bart (Canon) on Dec 18, 2007 at 13:53 UTC
    One other thing: using refaddr is not safe when using fork() (on windows) or threads (on any system) since the refaddr changes over a CLONE. Object::InsideOut seems to deal with this issue.
    But at what cost. Object::InsideOut has a huge overhead: Over 90% of the run time of the test script of the poster is spent generating a unique id for the objects. Madness.