perlquestion
princepawn
The following simple subroutine:
<code>
sub log_msg {
my $log_msg = shift;
print "value $script::debug";
if ($script::debug) {
print sprintf "(%s) $log_msg \n", shell_date;
}
}
</code>
still prints log messages when the <b>printed</b> value of $script::debug is 0.
<p>
So this yields two questions, and I would like an answer to both:
<li>What are all the false values in Perl? I know of the following:
<ol> <li> "0" <li> "" <li> 0 <li>0.0 </ol>
<li>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 <b> appears</b> to be zero when in fact there may be some hidden control char or something in the string.