Boolean values: Difference between revisions

added perl
(added perl)
Line 7:
=={{header|Java}}==
Java has <tt>true</tt> and <tt>false</tt> keywords, representing the only values of type <tt>boolean</tt>. There are also object wrappers <tt>Boolean.TRUE</tt> and <tt>Boolean.FALSE</tt>, of type <tt>Boolean</tt> which may be un-boxed into <tt>boolean</tt>s (auto-unboxed in Java 1.5+). There are no automatic conversions from any other types into <tt>boolean</tt>, and it is a compile-time error to use any type other than <tt>boolean</tt> or <tt>Boolean</tt> in a place that expects a <tt>boolean</tt> (e.g. if-statement condition, while-statement condition, operand of a logical operator, etc.).
 
=={{header|Perl}}==
The values in Perl that are false are: the number 0 (as a number, or as the string <tt>'0'</tt>), the empty string <tt>''</tt>, the empty list <tt>()</tt>, and <tt>undef</tt>.
 
Everything else is true.
 
Perl has no special "true" or "false" keywords.
 
=={{header|Python}}==
Anonymous user