<?xml version="1.0" encoding="windows-1252"?>
<node id="33638" title="What are all the false values in Perl ((conditional, boolean, whitespace, unprintable characters)" created="2000-09-22 15:16:53" updated="2005-08-08 12:04:38">
<type id="115">
perlquestion</type>
<author id="10395">
princepawn</author>
<data>
<field name="doctext">
The following simple subroutine:
&lt;code&gt;
sub log_msg {
  my $log_msg = shift;
  print "value $script::debug";
  if ($script::debug) {
      print sprintf "(%s) $log_msg \n", shell_date;
  }
}
&lt;/code&gt;

still prints log messages when the &lt;b&gt;printed&lt;/b&gt; value of $script::debug is 0.
&lt;p&gt;
So this yields two questions, and I would like an answer to both:
&lt;li&gt;What are all the false values in Perl? I know of the following:
&lt;ol&gt; &lt;li&gt; "0" &lt;li&gt; "" &lt;li&gt; 0 &lt;li&gt;0.0 &lt;/ol&gt;
&lt;li&gt;How do one brute-force print every character in a string even if it is typically unprintable? That is, my guess is that things are being printed even when $script::debug &lt;b&gt; appears&lt;/b&gt; to be zero when in fact there may be some hidden control char or something in the string.
</field>
</data>
</node>
