in reply to When warnings get in the way
but if I needed to code similar tests in several places I would go for:if (defined $foo and $foo eq 'true') {...}
sub is_true ($) { defined $_[0] and $_[0] eq 'true' } if (is_true $foo) {...} if (is_true $bar) {...}
|
---|