perlquestion
borisz
Hi,
I search for a better/shorter/more_readable way to set a var <tt>$x</tt> to exactly 0 or 1 depending on another var.
<br>
For example:
<code>
if ( $y ) {
$x = 1;
...
} else {
$x = 0;
}
</code>
I rewrote this to:
<code>
if ( $x = !!$y || 0 ) {
...
}
</code>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-224409">
Boris
</div></div>