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.

It is possible for this to print "Something was true?" but not tell you what was true. This is because $x or $y could be an overloaded object returning true or false at random each time they are checked.

Sorry to say that not one single programming language that has "stood the tests of time" – including, by the way, JavaScript – is immune to this. Programming languages are tools of our trade which usually are developed over many decades. Shit happens – and always will. "Engineer accordingly."