in reply to Moose and BUILD and 'ro' attributes
How do I set read-only variables in BUILD?
Why not just make a private writer, like this
has 'foo' => ( is => 'ro', isa => 'Something', writer => '_set_foo', lazy => 1, build => '_build_foo', );
Which is called first, BUILD or the attribute_builders?
The entire object instance is created and finalized before BUILD is called. When it gets to BUILD you can be sure you have a complete object (minus any non-initialized lazy attrs, etc).
|
|---|