package MyClass; use Any::Moose; has foo => ( is => 'ro', lazy => 1, default => sub { require Foo::Heavy; Foo::Heavy->new; }, );
-- regards, Roman
In reply to Re: Moose/Mouse: assigning default to attribute on first access?
by bobr
in thread Moose/Mouse: assigning default to attribute on first access?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |