<p>In reading about Perl 6, I see a feature being trumpeted about, where you no longer have to do:</p>

<pre><code>return "0 but true";
</code></pre>

<p>...but can instead do:</p>

<pre><code>return 0 but True;
</code></pre>

<p>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.</p>

<p>What are the rules in Perl 6 when it comes to boolean context?</p>

According to O'Reilly's
Perl 6 and Parrot Essentials
,
false
is 0, undef, the empty string, and values flagged as
false
.
true
is everything else.
Also, Perl 6 has both a primitive boolean type and by having True and False
roles
that any value can mix in (so you can have a "0 but True" value or a "1 but False" one for example, or a false list containing elements, or a true list that's empty).
See
http://www.mail-archive.com/macosx@perl.org/msg09930.html