|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re: Dear Moose docs...by tobyink (Prior) |
| on Feb 10, 2013 at 08:51 UTC ( #1018035=note: print w/ replies, xml ) | Need Help?? |
|
You're right that the docs are a little sparse in that area. There are some examples though - Moose::Manual::Attributes, Moose::Cookbook::Basics::Point_AttributesAndSubclassing, Moose::Cookbook::Basics::BankAccount_MethodModifiersAndSubclassing, etc. If you don't think this is enough, please submit a bug report. Out of the box, Moose supports two styles of object construction:
In your class it's possible to override BUILDARGS to add your own argument parsing...
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||