more useful options | |
PerlMonks |
Re^4: Moose and default valuesby tobyink (Canon) |
on Feb 22, 2013 at 11:41 UTC ( [id://1020140]=note: print w/replies, xml ) | Need Help?? |
Good question. I wasn't sure myself. I seem to recall RJBS saying that initializers were his first ever contribution to Moose, but that he regretted ever adding them. The best reasons I could come up with were:
Having asked in #moose, I've had the following additional suggestions:
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|