trigger => $code
The trigger option is a CODE reference which will be called
after the value of the attribute is set. The CODE ref is passed
the instance itself, the updated value, and the original value
if the attribute was already set.
The XS code could probably be written better without the has_old_value sentinel,
but I don't know how.
I pulled in t/attributes/attribute_triggers.t from the latest Moose as it has
compatible trigger tests. They switched from Test::Exception to Test::Fatal
so I've added Test::Fatal as an include.
Moose docs say...
The XS code could probably be written better without the has_old_value sentinel, but I don't know how.
I pulled in t/attributes/attribute_triggers.t from the latest Moose as it has compatible trigger tests. They switched from Test::Exception to Test::Fatal so I've added Test::Fatal as an include.
For rt.cpan.org 76880