if (defined $foo and $foo eq 'true') {...}