Boolean values: Difference between revisions

m
→‎Perl: removed example of deprecated code
(→‎Joy: add)
m (→‎Perl: removed example of deprecated code)
Line 1,993:
=== There are no keywords for true and false ===
 
Perl has no builtin "true" or "false" keywords. ThisAn isold atrick caveat,of becauseusing truethem and false areas bareword strings andis strongly discouraged evaluatein tomodern true:Perl.
 
<syntaxhighlight lang="perl"># This does not work
# true and false are not special so will be treated as bareword strings
if (true) { print "true is true\n" }; # This prints
if (false) { print "false is true\n" }; # So does this
if (spongebob) { print "spongebob is true\n" }; # A bareword string</syntaxhighlight>
 
=== Special cases ===
2,392

edits