|
|
|
|
|
by mst
4337 days ago
|
|
has foo => (is => 'rw', required => 1);
has bar => (is => 'ro', lazy => 1, builder => '_build_bar');
sets up both accessors and the relevant constructor logic - and bar's accessor will call the _build_bar method on self to get the value if it wasn't provided to the constructor.Method modifiers (before/after/around) are way more elegant than rename-the-method, and compose nicely from roles - and roles are substantially more powerful than mixins. |
|