From: "Hans Dieter Pearcey" <[email protected]> > On Sat, 29 Jan 2011 09:23:45 +0200, "Octavian Rasnita" <[email protected]> > wrote: >> I want to use some attributes that get a default value when they are not >> sent as constructor's parameters and also when they are sent as constructor >> parameters but with an undef value. > > Use MooseX::UndefTolerant. The undef values will be ignored and the normal > default/builder mechanism will kick in.
Thank you! I din't know about it. > A coercion is wrong, since that will be per-type, not per-attribute or > per-class. In that case I would need to define a subtype for each integer that has a different default value, considering that there is a subtype of Int that has the default value of 0, another subtype of Int that has a default value of 1, and so on. This would be much harder, of course. Thanks again. Octavian
