How does Perl 6 evaluate truthiness?
问题 In reading about Perl 6, I see a feature being trumpeted about, where you no longer have to do: return "0 but true"; ...but can instead do: return 0 but True; If that's the case, how does truth work in Perl 6? In Perl 5, it was pretty simple: 0, "", and undef are false, everything else is true. What are the rules in Perl 6 when it comes to boolean context? 回答1: Perl 6 evaluates truth now by asking the object a question instead of looking at its value. The value is not the object. It's