Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • One thing that I have trouble conceptualize is how to deal with attributes that are computed from other attributes ( for efficiency reasons ). I think it would help newcomers if an overview of how to deal with that was added to Moose::Manual::Construction. It's only recently that I discovered lazy_build - it seems like it is *the solution* to this problem - is that right? Are there any hidden disadvantages?
    • 'lazy_build' is nice, but any combination of 'lazy' with 'default' or 'builder' will work for this too. The first argument to 'default' and 'builder' is always the object instance, and if the attribute is also marked as 'lazy' then you are pretty much assured that the instance will be fully initialized as well (unless you have weird circular dependencies, but those are not terribly common).

      - Stevan