http://www.perlmonks.org?node_id=449132

borisz has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I search for a better/shorter/more_readable way to set a var $x to exactly 0 or 1 depending on another var.
For example:
if ( $y ) { $x = 1; ... } else { $x = 0; }
I rewrote this to:
if ( $x = !!$y || 0 ) { ... }
Boris