return $status == 0 ? 0 : 1; return !!$status; # Checks if $status is true or not, not if it is exactly zero; "" or undef are false, but not == 0. if ($status == 0) { return 0; } else { return 1; }