[sf-perl] the mouse with antlers

Chris Weyl cweyl at alumni.drew.edu
Wed Apr 4 21:17:55 PDT 2012


On Wed, Apr 4, 2012 at 8:45 PM, Jeffrey Thalhammer
<jeff at imaginative-software.com> wrote:
> Side note:  I've been hanging out on the #moose channel lately.  Apparently,
> lazy_build is out of fashion, because it also generates a predicate and
> clearer method for you, which you probably didn't want.  So now the
> recommended practice is...
>
> has id => ( lazy => 1,  builder => '_build_id' );

*shameless plug* Or, with MooseX::AttributeShortcuts:

has id => (is => 'lazy');
 - or -
has id => (is => 'ro', lazy => 1, builder => 1);

                          -Chris

-- 
Chris Weyl
Ex astris scientia


More information about the SanFrancisco-pm mailing list