sub booleanize ($) { shift ? 1 : 0 } $x = booleanize $y;