MooX::SetOnce - write-once attributes for Moose
package MyClass; use Moo; use MooX::SetOnce; has attr => ( is => 'rw', once => 1 );
MooX::SetOnce creates attributes that are not lazy and not set, but that cannot be altered once set.
The logic is very simple: if you try to alter the value of an attribute with the SetOnce trait, either by accessor or writer, and the attribute has a value, it will throw an exception.
If the attribute has a clearer, you may clear the attribute and set it again.
If a Moose module extends or composes a module using MooX::SetOnce, MooseX::SetOnce will be loaded to provide the Moose implementation.
haarg - Graham Knop (cpan:HAARG) <email@example.com>
None so far.
This library is free software and may be distributed under the same terms as perl itself.