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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Computed attributes (Score:1)
Re: (Score:1)
'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