in reply to When warnings get in the way

for a one time construction I would use
if (defined $foo and $foo eq 'true') {...}
but if I needed to code similar tests in several places I would go for:
sub is_true ($) { defined $_[0] and $_[0] eq 'true' } if (is_true $foo) {...} if (is_true $bar) {...}