On Tue, 26 Oct 2010, Evan Carroll wrote:

Line 26 doesn't even have a default (line 26 starts my stock declaration)

has 'stock'         => (
 is => 'rw'
 , isa => StockNo | Undef
 , coerce => 1
 , traits => ['String']
 , handles => { 'include_in_exports' => 'append' }
);

That's what the warning is about. You don't provide a default so the String native delegation trait provides a default for you (an empty string).

The warning tells you how to avoid it.

As to why it's deprecated, we decided it's a bad idea for a variety of reasons. Before 1.17, it actually simply caused an error if you provided a builder (because it added a default and you can't have both). If you made the attribute required, you still got a default default, which also made no sense.

Only a few native delegation traits provided a default default, to make things more confusing.

Overall, it was too much magic for no particular gain.


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/

Reply via email to