http://qs321.pair.com?node_id=11110563


in reply to Re: Defining, Testing and Documenting Perl?
in thread Defining, Testing and Documenting Perl?

Fun fact: the Moose "Bool" datatype will accept overloaded objects, but only if they stringify to "", "0", "1" or undef. It doesn't care what they boolify to!

Other fun fact: the Mouse "Bool" datatype will accept overloaded objects, but only if they boolify to a false value.

 

This is why Types::Standard 1.004 abandoned trying to be compatible with Moose and Mouse's definitions of "Bool" and instead just accepts "", "0", "1" and undef, but offers a coercion from other values.

  • Comment on Re^2: Defining, Testing and Documenting Perl?