On 5/21/08, Bernardo Rechea <[EMAIL PROTECTED]> wrote:
Hi Bernardo,
> I wanted a constant attribute, i.e., one that is read-only and not settable
> at construction time.
Does it have to be a full attribute? It could just be a method that
returns a constant. I often have this in my classes:
package Parent;
use constant needs_trinket => 0;
package Child;
use constant needs_trinket => 1;
Otherwise, if you need a full attribute, you could use:
has needs_trinket => (
init_arg => undef, # I think this works...
is => 'ro',
default => 0,
);
> Bernardo
Shawn